How to write product id in registry in wix

My demand is a hit. I need to write the product identifier in the registry during installation installation. I have a code for a product identifier.

<Product Id="{CEEE7807-F6D7-43F6-A206-110B9E25AC9C}" Name="Sample installer" UpgradeCode="{BFBD4770-8C5D-4A53-BA07-EF52401F0CB4}" Language="1033" Version="$(var.ProductVersion)" Manufacturer="My company."> 

I have code for a registry entry. I want to pass the product id value here.

 <Component Id="registry_values" Guid="{11FB6C4C-3C90-4F46-B0D2-BB95150F60E6}"> <RegistryValue KeyPath="yes" Root="HKCU" Key="Software\MyProduct\Myfolder\SampleFolder\Product" Value="[Product Id]" Type="string" /> </Component> 

Please help me solve this problem.

+4
source share
1 answer

Somewhat vaguely, the Id attribute of the WIX Product element maps to the Windows Installer ProductCode property.

 <Component Id="registry_values" Guid="{11FB6C4C-3C90-4F46-B0D2-BB95150F60E6}"> <RegistryValue KeyPath="yes" Root="HKCU" Key="Software\MyProduct\Myfolder\SampleFolder\Product" Value="[ProductCode]" Type="string" /> </Component> 
+11
source

Source: https://habr.com/ru/post/1390230/


All Articles