Using VS 2013, I have an old Windows Installer project that I am converting to WiX. I have the WiX project 90% complete with the appropriate dialogs being displayed and all files copying to the appropriate locations. However, my final task is to convert the Custom Actions that are defined in the old Windows Installer project under the sections for Install, Commit, Rollback and Uninstall.
I have been reviewing the code from the WixToolset Site, but I'm confused because I don't know how the WixShellExecTarget property ties to the CustomAction (as it doesn't reference that ID value) and I'm not sure how to pass in a parameter. Also, I don't want the actions to be based on a checkbox in the dialog... they should always run.
Basically, without using a dialog checkbox (which I "think" can be accomplised by using the InstallExecuteSequence section as opposed to the UI\Publish section), upon install (or commit), I need the following to run in order:
[INSTALLFOLDER]RegisterExtensionDotNet20.exe -i "[INSTALLFOLDER]MyNamespaceExtension.dll"
[INSTALLFOLDER]MyApplication.exe
Then, upon uninstall (or rollback), before the files are deleted from the folder, I need just the following to run (note the change in the parameter from "-i" to "-u"):
[INSTALLFOLDER]RegisterExtensionDotNet20.exe -u "[INSTALLFOLDER]MyNamespaceExtension.dll"
Here's a snippit of my code (for just the first action... I haven't figured out how to name the second action to run MyApplication.exe yet), but it doesn't seem to be running upon install (and I haven't figured out the uninstall part).
<Product>
<!-- UI, Properties, Directories, Components and Features defined here... -->
<Property Id="WixShellExecTarget" Value="[INSTALLFOLDER]RegisterExtensionDotNet20.exe -i '[INSTALLFOLDER]MyNamespaceExtension.dll'" />
<CustomAction Id="RegisterDotNetExtensionx64" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<InstallExecuteSequence>
<Custom Action="RegisterDotNetExtension" Before="InstallFinalize" />
</InstallExecuteSequence>
</Product>
Any input is greatly appreciated!