views:

602

answers:

3

I want to include some dynamic part in the filename of the msi file my wix projects produce. This dynamic part should be controlled by variables which are part of my wix project and are declared like this:

<?define ProductVersion="7.1.0.1" ?>

Does anybody know about a way of sending that value of that wix variable to the linker to use it as a part of the output filename?

By the way: I'm using Wix3

+2  A: 

Since it's just a file name, why not have a post-build action that renames the file in your build script (assuming MSBuild)?

Agent_9191
Ok, that would work probably. I will try that out. But i was looking for a more direct way - or do you think this is not supported in wix?I read something about linker variables here: http://n2.nabble.com/Types-of-variables-question-td3825142.html!(wix.Name) gets what are called WixVariables (can be defined in source code with the WixVariable element, or passed on the commandline of light and/or lit in a manner similar as preprocessor variables are passed to candle). But that doesn't seem to work.
Jan
I mentioned this way since it's the quickest and simplest way to handle it. Like so many other development problems, always remember to KISS.
Agent_9191
+1  A: 

The msi file name is not determined by your wix files, but by the light.exe -out switch. You can use the same value for -out and inside your wix files if you do the following in your build script, assuming it is a batch script:

  • set an environment variable with set productversion=1.2.3
  • Pass -out foo%productversion%.msi to the light.exe linker
  • use the same environment variable in your wix files as $(env.productversion)
Wim Coenen
A: 

Product Id="GUID" Name="whatevername $(var.ProductVersion)"

irfanyar

related questions