1

我想执行我的 .exe 文件,该文件MessageBox在单击“确定”时显示并退出。CustomAction应在安装完成后,但在显示Finish对话框之前执行。问题是,我无法将主安装程序窗口设置为等待单击“确定”按钮(Finish直接显示对话框,因此无需单击“确定”按钮即可完全关闭主窗口)。WiX 工具集版本:v3.10

产品源代码:

<Property Id="WixShellExecTarget" Value="[#ExeId]" />
<InstallExecuteSequence>
  <Custom Action="LaunchExe" After="InstallFinalize" />
</InstallExecuteSequence>
<CustomAction Id="LaunchExe" BinaryKey="WixCA" DllEntry="WixShellExec" Execute="immediate" Return="check" Impersonate="yes" />

组件源代码:

<Component Id="ExeId" Directory="APPLICATIONFOLDER" Guid="*">
  <File Id="ExeId" Source=".\ExeName.exe" KeyPath="yes" Checksum="yes" />
</Component>
4

1 回答 1

2

好的,我设法运行它。结果代码是:

<InstallExecuteSequence>
  <Custom Action="LaunchExe" Before="InstallFinalize">NOT Installed AND NOT REMOVE</Custom>
  </InstallExecuteSequence>
<CustomAction Id="LaunchExe" FileKey="ExeId" ExeCommand="" Execute="deferred" Return="check" Impersonate="no" /> 

请注意,NOT Installed AND NOT REMOVE必须添加条件,因为 Windows 无法卸载该应用程序。

于 2016-07-29T11:31:38.703 回答