为什么不尝试这样的事情:
[Files] Source: ClientSetup.msi; DestDir: {tmp}; Flags: deleteafterinstall; Components: Client Source: ServerSetup.msi; DestDir: {tmp}; Flags: deleteafterinstall; Components: Server [Run] Filename: msiexec.exe; Parameters: /i "{tmp}\ClientSetup.msi" /qb INSTALLDIR="{code:GetInstallPath}\Client\" ALLUSERS=2; WorkingDir: {tmp}; StatusMsg: Installing client; Components: Client Filename: msiexec.exe; Parameters: /i "{tmp}\ServerSetup.msi" /qb INSTALLDIR="{code:GetInstallPath}\Server\" ALLUSERS=2; WorkingDir: {tmp}; StatusMsg: Installing server; Components: Server [Components] Name: Client; Description: Client Installation Name: Server; Description: Server Installation
当然你不一定要用Components
.您没有写下如何决定运行哪个安装程序.如果您需要更复杂的逻辑,您还可以使用以下Check
函数:
[Files] Source: ClientSetup.msi; DestDir: {tmp}; Flags: deleteafterinstall; Check: CheckClient Source: ServerSetup.msi; DestDir: {tmp}; Flags: deleteafterinstall; Check: CheckServer [Run] Filename: msiexec.exe; Parameters: /i "{tmp}\ClientSetup.msi" /qb INSTALLDIR="{code:GetInstallPath}\Client\" ALLUSERS=2; WorkingDir: {tmp}; StatusMsg: Installing client; Check: CheckClient Filename: msiexec.exe; Parameters: /i "{tmp}\ServerSetup.msi" /qb INSTALLDIR="{code:GetInstallPath}\Server\" ALLUSERS=2; WorkingDir: {tmp}; StatusMsg: Installing server; Check: CheckServer [Code] function CheckClient: Boolean; begin Result := WhateverCondition; end; function CheckServer: Boolean; begin Result := WhateverOtherCondition; end;