I need to define a variable in the Pre-Build event of my Visual Studio project to be used later by Wix.
Since the build event allows me to execute commands, my idea was to add a new environment variable (I've tried both set
and setx
):
setx AppIcon MyIcon.ico
And then I've tried to read it in my Main.wxs file:
<Icon Id="AppIcon" SourceFile="$(sys.CURRENTDIR)..\ApplicationIcon\$(env.AppIcon)" />
But of course, I got Undefined preprocessor variable '$(env.AppIcon)'.
Any other ideas on how to accomplish this? Is it possible?