简体   繁体   中英

Wix - Run an exe ( with arguments ) at end of install, which wasn't installed by current MSI

I have a MSI created in WiX 3.6 that obviously installs various things and creates a shortcut to an exe that isn't actually installed by my MSI ( we know for certain that the exe is located in a specific folder, because it's installed by a seperate MSI, that is a required pre-req for my MSI ). The shortcut we create, passes in some arguments that actually tell the exe to use stuff that we've just installed. This all works fine, but I now want the MSI to automatically run the exe with the same arguments as we use in the shortcut.

I tried following this article - http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html but it assumes you want to run an exe you have just installed and doesn't seem to use exe arguments.

I also tried using a custom action like -

<CustomAction Id="RunMainApp"
          Directory="FREDFOLDER"
          ExeCommand="[FREDFOLDER]Fred.exe -SBDSingleApp -SBDSplash=&quot;MySplash.bmp&quot;"
          Execute="commit"
          Return="ignore"/>

<InstallExecuteSequence>
  <Custom Action="RunMainApp" Before="InstallFinalize" />
</InstallExecuteSequence>

this was more promising - it ran the exe, but did so before the actual installation had finished - which obviously isn't correct.

To be honest, I'm not that bothered if about having a UI as in the first example - because 90% of the time the MSI will be run in quiet mode without the wizard been displayed.

您是否尝试过将Execute =“ commit”更改为Execute =“ deferred”,这将使自定义操作在安装脚本运行之后运行,但在安装过程完成之后不会运行,因为后者可能不在执行上下文中安装。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM