My requirement is blow. I need to write the Product Id in registry while install the setup. I have the below code for Product Id.
<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 below code for write Registry. 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 to solve this problem.
Product. wxs is the source file of your setup project. A newly created project contains the XML code shown below.
The KeyPath for a Component is a single resource that the Windows Installer uses to determine if a Component "exists" on a machine. This means that when Windows Installer decides whether to install your component, it will first look whether the keypath resource is already present.
Click File, then select New, then select Project. Choose the Visual C# node in the Project Types tree, then select Windows Forms Application. Name your application "MyApplication" and press OK.
Somewhat confusingly, 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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With