Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set registry value in wix?

I am trying to set the registry value for my installation location in my WiX. I want to set the key in localmachine/software so I used the following WiX file. I am not getting any build error, everything is going right but the registry value is not set.

 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

     <?define engage.client.app_TargetDir=$(var.engage.client.app.TargetDir)?>
     <Product Id="*" Name="EngageSetupCreator" Language="1033" Version="1.0.0.0" Manufacturer="KrimzenInc" UpgradeCode="PUT-GUID-HERE">
       <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" AdminImage="yes" />

       <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
       <MediaTemplate />

      <Feature Id="ProductFeature" Title="EngageSetupCreator" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
        <ComponentGroupRef Id="ProductComponents2" />
        <ComponentRef Id="InstallRegistryComponent"/>
        <!--<ComponentGroupRef Id="Assets"/>-->
      </Feature>
     </Product>
     <Fragment>
      <SetDirectory Id="INSTALLFOLDER" Value="[WindowsVolume]Engage" />
       <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="WINDOWSVOLUME">
         <Directory Id="SUB_FOLDER" Name="Engage">
          <Directory Id="INSTALLFOLDER" Name="EngageSetupCreator" >
            <Component Id="InstallRegistryComponent" Guid="*">
             <RegistryKey Id='ChessInfoBarInstallDir' Root='HKLM' Key='Software\Crimson\Engage' Action='createAndRemoveOnUninstall' >
              <RegistryValue Type='string' Name='InstallDir' Value="[INSTALLFOLDER]" Action="write" KeyPath="yes" />

             </Component>
            </Directory>
          </Directory>
        </Directory>
      </Directory>
     </Fragment>
     <Fragment>
      <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

       <Component Id="engage.client.app.exe" Guid="*">
         <File Id="engage.client.app.exe" Name="engage.client.app.exe" Source="$(var.engage.client.app_TargetDir)engage.client.app.exe"  />
       </Component>


       <Component Id="CefSharp.BrowserSubprocess.exe" Guid="*">
         <File Id="CefSharp.BrowserSubprocess.exe" Name="CefSharp.BrowserSubprocess.exe" Source="$(var.engage.client.app_TargetDir)CefSharp.BrowserSubprocess.exe" />
       </Component>

      </ComponentGroup>-->



      <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch KrimzenEngage" />

     <!-- Step 3: Include the custom action -->
     <Property Id="WixShellExecTarget" Value="[#engage.client.app.exe]" />
     <CustomAction Id="LaunchApplication"
        BinaryKey="WixCA"
        DllEntry="WixShellExec"
        Impersonate="yes" />

     </Fragment>

 </Wix>

but its not setting the value. what iam doing wrong? I am running this in 64bit system.

like image 751
vishnuprasad kv Avatar asked Sep 03 '25 02:09

vishnuprasad kv


1 Answers

On 64-bit systems, 32-bit software registry keys normally found in "HKLM\Software\ExampleSoftware" are instead found in "HKLM\Software\WOW6432Node\ExampleSoftware". Check here for more information.

like image 134
Calum MacLeod Avatar answered Sep 05 '25 01:09

Calum MacLeod