2017-06-03 24 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,因爲它確實使用這些名稱來定義函數。