Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 303
Tall Tyke Avatar asked Aug 28 '13 18:08

Tall Tyke


1 Answers

Have you tried changing Execute="commit" to Execute="deferred", this will make the custom action run after the installation script has run, but not after the install process has completed, for the latter you would be outside of the execution context of the install.

like image 86
David Martin Avatar answered Nov 08 '22 12:11

David Martin