Deploy and Run application at beginning of WIX Install

Posted by Doctor Fro on Stack Overflow See other posts from Stack Overflow or by Doctor Fro
Published on 2010-05-18T01:15:09Z Indexed on 2010/05/18 1:20 UTC
Read the original article Hit count: 210

Filed under:
|
|

I'm trying to deploy and run an application (C# console app) at the beginning of the MSI install with WIX but having some difficulty.

The application needs to run before any of the webserver actions happen but after the files have been copied from the MSI to the target location.

I can get the app to run but only if I have actually copied the application in the directory before I run the MSI. If I don't do that, I get an error relating to the app not existing in the MSI logs. So basically I think it has to do with the launch sequence I am using I need to ensure that the app exists before it is run.

Wondering if one of you good folks could help me out.

The requirement is that the application must run as the first thing the WIX MSI does, (well actually before any of the webservice parts happen).

The relevant bits of the Wix are as follows.

    <CustomAction Id='LaunchUpdaterRunFirst' FileKey='serverUpdaterRunFirstExe' ExeCommand='' Return='ignore' />

...

    <InstallExecuteSequence>
       <Custom Action='CA_BlockOlderVersionInstall' After='FindRelatedProducts'>NEWERVERSIONDETECTED</Custom>
       <RemoveExistingProducts After="InstallInitialize" />
       <Custom Action='LaunchUpdaterRunFirst' After='InstallInitialize' />
       <Custom Action='LaunchInstaller' After='InstallFinalize'><![CDATA[ REMOVE <> "ALL" and  UILevel <> 2]]></Custom>
    </InstallExecuteSequence>

...

     <Component Id="ServerInstaller" DiskId="1" Guid="9662EC72-1774-4d22-9F41-AD98A5DCD729">
        <File Id="serverUpdaterRunFirstExe" Name="MyCompany.Server.Updater.RunFirst.exe" Source="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe" />
        <File Id="serverUpdaterRunFirstExeConfig" Name="MyCompany.Server.Updater.RunFirst.exe.config" Source="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe.config" />

Any help or references greatly appreciated.

© Stack Overflow or respective owner

Related posts about wix

Related posts about installer