2017-06-03 28 views
1

尝试调用下标以将MS SQL Server安装为Inno Setup的一部分。在Inno Setup中无法识别AddProduct和isX64功能

在主脚本中,我包括在运行区段标,并呼吁与BeforeInstall的过程:

[Run] 
#include "MSSQLExpress2014WithTools.iss"; 
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; BeforeInstall: sql2014express() 

到目前为止好,但它似乎是Inno Setup的不喜欢的我MSSQLExpress2014WithTools.iss下标:

[CustomMessages] 
sql2014expressx86_title=Microsoft SQL Server 2014 Express Edition x86 (Including Tools) 
sql2014expressx64_title=Microsoft SQL Server 2014 Express Edition x64 (Including Tools) 

sql2014expressx86_size=840.8 MB 
sql2014expressx64_size=833.2 MB 
[Code] 
const 
    sql2014expressx86_url='http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2032BIT/SQLEXPRWT_x86_ENU.exe'; 
    sql2014expressx64_url='http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2064BIT/SQLEXPRWT_x64_ENU.exe'; 

procedure sql2014expresswithtools(); 
var 
    version: string; 

begin 
    { Check if the full version fo the SQL Server 2014 is installed } 
    RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\SQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', version); 
    if (version < '12') or (version = '') then 
    begin 
    { If the full version is not found then check for the Express edition } 
    RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion', 'CurrentVersion', version); 
    if (version < '12') or (version = '') then 
    begin 
     if isX64() then AddProduct('SQLEXPRWT_x64_ENU.exe', '/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /FEATURES=SQL,AS,RS,IS,Tools /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSYSADMINACCOUNTS="builtin\Administrators" /INDICATEPROGRESS /TCPENABLED=1 /BROWSERSVCSTARTUPTYPE=Automatic /ERRORREPORTING=0 /SQMREPORTING=0 /SECURITYMODE=SQL /SAPWD=1234', CustomMessage('sql2014expressx64_title'), CustomMessage('sql2014expressx64_size'), sql2014expressx64_url,false,false) 
     else AddProduct('SQLEXPRWT_x86_ENU.exe', '/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /FEATURES=SQL,AS,RS,IS,Tools /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSYSADMINACCOUNTS="builtin\Administrators" /INDICATEPROGRESS /TCPENABLED=1 /BROWSERSVCSTARTUPTYPE=Automatic /ERRORREPORTING=0 /SQMREPORTING=0 /SECURITYMODE=SQL /SAPWD=1234', CustomMessage('sql2014expressx86_title'), CustomMessage('sql2014expressx86_size'), sql2014expressx86_url,false,false); 
    end; 
    end; 
end; 

它不承认AddProductisX64功能。

任何提示赞赏!

回答

0

Inno Setup中没有AddProductisX64函数。

你可能已经在一些例子中使用了你的代码,它使用了一些Inno Setup扩展/插件,它增加了这些功能。

我认为插件是Modular InnoSetup Dependency Installer,因为它确实使用这些名称来定义函数。