I'm trying to create an installer with a UI, using WiX.
My INSTALLFOLDER is set up using this:
<Directory Id="TARGETDIR"
Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="ManufacturerFolder"
Name="[Manufacturer]">
<Directory Id="INSTALLFOLDER"
Name="[ProductName]" />
</Directory>
</Directory>
</Directory>
In the <Product> section, I'm defining:
<UIRef Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
<Property Id="WIXUI_INSTALLDIR"
Value="INSTALLFOLDER" />
When I run the installer and get to the Destination Folder panel, I see:
Install Service to:
C:\Program Files\[Manufacturer]\[ProductName]\
How can I make it evaluate the variables for display?
Note: if I leave them, and click Next, Install and Finish it works. It just looks bad.
Download. You can download the WiX toolset for free.
Binder variables can make this very easy without needing to mess around defining preprocessor variables. It'd go a lot like this:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="ManufacturerFolder" Name="!(bind.property.Manufacturer)">
<Directory Id="INSTALLFOLDER" Name="!(bind.property.ProductName)" />
</Directory>
</Directory>
</Directory>
The !(bind.)
syntax is documented in the Linker (light)
topic in WiX.chm.
Define your variables in a config file.
For example, create a file named config.wxi containing the following:
<?xml version="1.0" encoding="utf-8"?>
<Include>
<?define Manufacturer = "Company Name" ?>
<?define ProductName = "Product Name" ?>
</Include>
Then reference the variables in your .wxs file using $(var.Manufacturer)
and $(var.ProductName)
.
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