how to execute an exe during wix install
Asked Answered
R

2

6
<CustomAction Id="RegisterEXE" Directory="INSTALLDIR" ExeCommand="&quot;INSTALLDIR]MyApp.exe&quot; /Register" Execute="immediate" Return="ignore" />   
<InstallExecuteSequence>
  <Custom Action='RegisterEXE' After='InstallFinalize' />
</InstallExecuteSequence>

I have used this code But it does not execute the exe. Exe register itself as ole server and perform few other tasks.

Radiophone answered 10/4, 2014 at 5:12 Comment(0)
C
16

use this

<CustomAction Id="RegisterEXE"
                  Directory="INSTALLDIR"
                  ExeCommand="&quot;[INSTALLDIR]TKW5.exe&quot; /Register"
                  Execute="deferred"
                  Return="ignore"  
                  Impersonate="no"
                 />

<InstallExecuteSequence>
      <Custom Action='RegisterEXE' After='InstallFiles' />
</InstallExecuteSequence>
Choplogic answered 10/4, 2014 at 7:55 Comment(5)
For anyone out there if this does not work try setting CustomAction/@Execute to immediate as described here: #8586418Indoeuropean
May be obvious to some - but I had to place this inside the <Product> element - otherwise it was ignored as I was putting it in a fragment which wasn't referenced anywhere.Logrolling
Thanks a lot! Why is the [INSTALLDIR] required for the ExeCommand when it is already set for the Directory?Dulla
@Dulla [INSTALLDIR] is used in the ExeCommand to provide the full path to the executable, while the Directory attribute sets the working directory for the custom action itself. This ensures that the custom action runs in the correct directory, and the executable is invoked with the correct pathChoplogic
This did indeed run my exe but left the installer hanging, the code below though made the installer close first then ran my exe: <InstallExecuteSequence> <Custom Action='RegisterEXE' After='InstallFinalize'>NOT Installed</Custom> </InstallExecuteSequence> apologies for the formatting but it's not giving me any formatting optionsLiquidation
E
0

It's workig like the way also.

  <CustomAction Id="RegisterEXE"
                  Directory="INSTALLFOLDER"
                  ExeCommand="&quot;[INSTALLFOLDER]DesktopAlertingClient.exe&quot;"
                  Execute="immediate"
                  Return="asyncNoWait"  
                  Impersonate="no"
                 />

      <InstallExecuteSequence>
            <Custom Action='RegisterEXE' After='InstallFinalize'></Custom>
      </InstallExecuteSequence>
Enalda answered 1/8 at 16:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.