views:

61

answers:

2

What is the best/easiest way to install a namespace extension using wix? Especially how do I install it on Windows 7 with enabled UAC.

A: 

You need to add namespace extension specific registry entries for it to work. Many of these entries require admin privileges. So installing with UAC ON is not possible unless the user allows elevation.

logicnp
I've configured wix to require elevated privileges. The namespace extension I'm trying to create a installer for uses your EZNamespaceExtension. Is it possible to use autoregistration? Or will I have to find all registry keys necessary?
Wienczny
+1  A: 

I've solved this with by using a built in custom action from WiX where you just set the command line option before running the custom action. Here's an example how we do it:

<CustomAction Id='RegisterExtensions.SetProperty' Property='QtExecCmdLine' 
    Value='"[INSTALLDIR]RegisterExtensionDotNet20_x86.exe" -i "[INSTALLDIR]LogicNP.EZShellExtensions.dll" "[INSTALLDIR]LogicNP.EZNamespaceExtensions.dll" "[INSTALLDIR]MyNse.dll"'/>

<CustomAction Id='RegisterExtensions' BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>

This has to be done also for 64 bit. I have separate 64 bit version of the custom action also:

<CustomAction Id='RegisterExtensions64.SetProperty' Property='QtExecCmdLine'
      Value='"[INSTALLDIR]RegisterExtensionDotNet20_x64.exe" -i "[INSTALLDIR]LogicNP.EZShellExtensions.dll" "[INSTALLDIR]LogicNP.EZNamespaceExtensions.dll" "[INSTALLDIR]MyNse.dll"'/>

<CustomAction Id='RegisterExtensions64' BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>

You have to schedule the registration process also into the WiX build file:

<Custom Action="RegisterExtensions.SetProperty" Before="RegisterExtensions">(NOT Installed)</Custom>
<Custom Action='RegisterExtensions' After="InstallFinalize">(NOT Installed)</Custom>
<Custom Action='RegisterExtensions64.SetProperty' Before='RegisterExtensions64'>(NOT Installed) AND (VersionNT64)</Custom>
  <Custom Action='RegisterExtensions64' After='RegisterExtensions'>(NOT Installed) AND (VersionNT64)</Custom>

A consequence is that you need to include the EZNamespaceExtension executables in your installer.

tronda
Thanks for your help. I just hoped it would be more simple ;-)
Wienczny
We all hope when working with installing on Windows, but I get hit in the face each time :-)
tronda