<CustomAction Id="RegisterEXE"
Directory="INSTALLDIR"
ExeCommand=""[INSTALLDIR]MyApp.exe" /Register"
Execute="immediate"
Return="ignore"
/>
<InstallExecuteSequence>
<Custom Action='RegisterEXE' After='InstallFinalize' />
</InstallExecuteSequence>
The exe should be registered as ole server. but it does not register.
The
CustomAction
AttibuteImpersonate
has default value ofyes
. You need to set it to no to run the executable with Elevated permission (The permission which installer have now). OLE Server registration requires changes in HKCU and HKLM.Read Wix doc
Per Windows Installer Best Practices:
The reason is that self registration is an out of process execution that is slower, prone to failure and untrackable by the Windows Installer. This creates problems for resilency, rollback, uninstall and upgrade scenarios. The better approach is to "harvest" the COM metadata from the EXE and author it natively into the MSI. This way MSI simply copies the files and applies the registry entries. In the event of a rollback, MSI knows what it did and simply reverts it. For more information see:
Reasons for Avoiding Self Registration
The way to achieve this in WiX is to run the EXE through Harvest Tool (Heat). This will generate a .WxS fragment that you can then include in your installer.