I have an WIX installer. I try to add a registry key depending on the installation path (VS Installer easy) in this case thought it would be a piece of cake ... This is my XML for WIX:
<Feature Id="ProductFeature" Title="ChessBarInfoSetup" Level="1">
<!--<ComponentGroupRef Id="ProductComponents" />-->
<ComponentRef Id='InstallRegistryComponent' />
<ComponentRef Id='ProductComponent' />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ManufacturerFolder" Name="$(var.manufacturer)">
<Directory Id="INSTALLFOLDER" Name="$(var.productName)">
<!--<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">-->
<Component Id="InstallRegistryComponent" Guid="*">
<RegistryKey Id='ChessInfoBarInstallDir' Root='HKLM' Key='Software\[Manufacturer]\[ProductName]' Action='createAndRemoveOnUninstall'>
<RegistryValue Type='string' Name='InstallDir' Value="[INSTALLDIR]" Action="write" KeyPath="yes" />
<!--<RegistryValue Type='integer' Name='Flag' Value='0'/>-->
</RegistryKey>
</Component>
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent" Guid="*">
<File Source="$(var.ChessInfoTaskBar.TargetPath)" />
</Component>
<!--</ComponentGroup>-->
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
The value is created but is always an empty string. Tried it with INSTALLLOCATION and others... What am I doing wrong (saw the Value=[INSTALLDIR] on a wix tutorial page)?