Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested variables in Wix

Tags:

wix

I am creating a WIX template for my projects to ensure a relatively standard layout.

I have defined a variable to reference the Main Application using <?define MainApp="MyApp"?> where MyApp is the name of the referenced project. I then use the MainApp variable to reference the project's properties in the .wxs and .wxi files.

However, I have an issue when referencing nested properties.

$var.($(var.MainApp).ProjectName) expands to "MyApp" without issue.

$var.($(var.MainApp).ProjectDir)Resources\Main.ico expands to $var.(MyApp.ProjectDir)Resources\Main.ico

$var.($(var.MainApp).TargetPath) expands to $var.(ConsoleApplication1.TargetPath)

etc...

My aim is to create a single definition for my main application, thus eliminating a search/replace, which I find clunky.

like image 781
The Joker Avatar asked May 15 '26 12:05

The Joker


1 Answers

As you've found, nested preprocessor variables are not supported by the WiX toolset today.

like image 169
Rob Mensching Avatar answered May 18 '26 21:05

Rob Mensching



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!