0

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.

Wienczny
  • 3,958
  • 4
  • 30
  • 35

2 Answers2

1

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
  • 3,902
  • 4
  • 33
  • 55
0

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
  • 5,796
  • 1
  • 28
  • 32
  • 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 Feb 23 '10 at 12:46