WIX will not add HKLM registry setting during Windows 7 install

Posted by Scott Boettger on Stack Overflow See other posts from Stack Overflow or by Scott Boettger
Published on 2009-12-10T16:04:40Z Indexed on 2010/04/05 7:43 UTC
Read the original article Hit count: 545

Filed under:
|
|
|

Good Morning,

I have written a WiX installer that works perfectly with Windows XP but when installing to a Windows 7 box I am running into difficulty with Registry Entries. What I need to do is add a HKLM entry as well as the registry entry for the program to show in the start menu. Here is the code i am using for both types of entry:

<!-- Create the registry entries for the program -->
<DirectoryRef Id="TARGETDIR">
  <Component Id="RegistryEntriesInst" Guid="...">
    <RegistryKey Root="HKLM"
                 Key="Software\$(var.Manufacturer)\$(var.ProductName)"
          Action="createAndRemoveOnUninstall">
      <RegistryValue Type="string" Name="installed" Value="true" KeyPath="yes"/>
    </RegistryKey>
  </Component>
  <Component Id="RegistryEntriesVer" Guid="...">
    <RegistryKey Root="HKLM"
                 Key="Software\$(var.Manufacturer)\$(var.ProductName)"
          Action="createAndRemoveOnUninstall">
      <RegistryValue Type="string" Name="version" Value="$(var.ProductVersion)" KeyPath="yes"/>
    </RegistryKey>
  </Component>
</DirectoryRef>

<!-- To add shortcuts to the start menu to run and uninstall the program-->
<DirectoryRef Id="ApplicationProgramsFolder">
  <Component Id="ApplicationShortcut" Guid="...">
    <Shortcut Id="ApplicationStartMenuShortcut"
              Name="$(var.ProductName)"
              Description="..."
              Target="[SERVERLOCATION]$(var.Project.TargetFileName)"
              WorkingDirectory="SERVERLOCATION"/>
    <Shortcut Id="UninstallProduct"
                  Name="Uninstall $(var.ProductName)"
                  Description="..."
                  Target="[System64Folder]msiexec.exe"
                  Arguments="/x [ProductCode]"/>
    <RemoveFolder Id="SERVERLOCATION" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
    </Component>
</DirectoryRef>

Any help/suggestions that can be given will be appreciated. On a side note the registry permissions are the same on the XP and 7 computers.

Thanks

© Stack Overflow or respective owner

Related posts about wix

Related posts about installer