WiX: Dynamic product name

时间:2016-04-25 09:30:55

标签: wix wix3.10

How can I dynamically set my product name in my product.wxs file?

My idea was to create a custom dialog where the user can choose between either 2015, 2016 or 2017 via radio buttons. The year is supposed to be the suffix for my product name:

 <Product Id="*"
          Name="BlaBla 2015"
          Language="1033"
          Version="$(var.SomePluginVersion)"
          Manufacturer="MyCompany"
          UpgradeCode="{SOME-GUID}">

I guess the custom dialog has to set a preprocessor variable so the product name can be defined before the actual installation process. But how would I do that?

1 个答案:

答案 0 :(得分:1)

ProductName是一个属性,您可以将其设置为您想要的任何动态值。例如:

<Property Id="Year">2016</Property>

<CustomAction Id="SetProductName" Property="ProductName" Value="Product [Year]" />
<InstallExecuteSequence>
  <Custom Action="SetProductName" After="InstallInitialize"/>
</InstallExecuteSequence>