1

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!

bigmac
  • 2,553
  • 6
  • 38
  • 61

1 Answers1

0

Assuming I've understood registerextensionDotnet20.exe, you don't need it. For assembly registration look at Heat.exe in the WiX toolset. This kind of thing:

How to run heat.exe and register a dll in wix

The you don't need anything else, no rollback, no uninstall etc because it all becomes part of the registry data in the MSI file that handles everything automatically.

(Even in the VS setups you should have been able to do this by setting the properties of the Dll to a flavor of vsdraCOM. )

Community
  • 1
  • 1
PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • thanks for the information, but registerextensionDotnet20.exe is program from SSWare's EZNamespaceExtensions. It basically creates a Windows shell extension for a virtual drive, which is use by MyApplication. To install the extension, I have to call their EXE, passing in my DLL, in order for it to properly register it's components. I don't think that heat.exe can replace this functionality. Does that make sense? – bigmac Apr 19 '15 at 21:54