5
<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.

Sarvesh Mishra
  • 2,014
  • 15
  • 30
chetan
  • 75
  • 1
  • 1
  • 4

1 Answers1

12

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>
Sarvesh Mishra
  • 2,014
  • 15
  • 30
  • For anyone out there if this does not work try setting CustomAction/@Execute to immediate as described here: https://stackoverflow.com/questions/8585918/wix-install-error-2762-while-invoking-a-customaction-from-dialog/8587072 – J. Krz Mar 13 '19 at 08:57
  • 3
    May be obvious to some - but I had to place this inside the element - otherwise it was ignored as I was putting it in a fragment which wasn't referenced anywhere. – phil_rawlings Feb 07 '21 at 17:32