Inno Setup中无法识别AddProduct和isX64功能

时间:2017-06-03 12:01:41

标签: inno-setup

尝试调用下标来安装MS SQL服务器作为Inno Setup的一部分。

在主脚本中,我在运行部分中包含下标,并使用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函数。

任何提示都赞赏!

1 个答案:

答案 0 :(得分:0)

Inno Setup中没有AddProductisX64功能。

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

我认为插件是Modular InnoSetup Dependency Installer,因为它确实定义了具有这些名称的函数。