安装后启动应用程序

时间:2011-03-04 14:20:29

标签: wix

我已经google了一下,发现了一些像

这样的话题

http://wix.sourceforge.net/manual-wix3/run_program_after_install.htm

Launch application after installation complete, with UAC turned on

但是,我不使用任何ui。只需简单的安装! 到目前为止

<CustomAction Id="LaunchApp" Directory="INSTALLDIR" ExeCommand="[SystemFolder]cmd.exe /C MyExe.exe" />

<InstallExecuteSequence>
      <RemoveExistingProducts Before="InstallInitialize" /> 
      <Custom Action="LaunchApp" After="InstallFinalize" />
    </InstallExecuteSequence>

但是当我启动安装程序时,会弹出一个窗口:“请等待Windows配置MyProgram”。在它上面只有一个闪烁的光标cmd.exe,当我关闭cmd时,我收到消息:“这个Windows Installer程序包有问题。无法运行此安装完成所需的程序。”虽然计划仍然开放。 我怎样才能正确地做到这一点(没有任何UI)? 提前谢谢!

3 个答案:

答案 0 :(得分:15)

如果您使用

会发生什么
ExeCommand="[SystemFolder]cmd.exe /C start MyExe.exe"

答案 1 :(得分:5)

Return设置为 asyncNoWait 以进行自定义操作。这样,自定义操作就会运行,安装程序不会等待它或检查其返回代码。

答案 2 :(得分:1)

我有一个问题,它也试图在卸载时运行。.这样,它只能在安装,修复和更新(更改)时运行

<CustomAction Id="LaunchApp" Directory="INSTALLFOLDER" ExeCommand="[SystemFolder]cmd.exe /C start MyFile.exe" />

<InstallExecuteSequence>
  <Custom Action="LaunchApp" After="InstallFinalize">NOT REMOVE</Custom>
</InstallExecuteSequence>

有关NOT REMOVE的信息可以在这里找到:https://stackoverflow.com/a/17608049/9758687