Reputation: 977
I have a Wix install project in Visual Studio 2012 and have an xml node like
<MsiPackage ... DownloadUrl="http://uat.mywebsite.com/MyMSI.msi">
I want to change the url depending on the build configuration. i.e. in uat I want it to be http://uat.mywebsite.com/... and in release http://mywebsite.com/...
Is this possible, and if so how do I do it?
Upvotes: 2
Views: 359
Reputation: 3797
Your WiX project has access to build parameters, like the Configuration (debug
or release
). You can conditionally include the correct DownloadUrl
for the current configuration by referencing $(var.Configuartion)
in your component declarations:
Not tested this but something similar should work:
<?if $(var.Configuartion) = Release?>
<?define DownloadUrl = "http://uat.mywebsite.com/" ?>
<?elseif $(var.Configuartion) = Debug?>
<?define DownloadUrl = "http://mywebsite.com/" ?>
<?endif ?>
<MsiPackage ... DownloadUrl="$(var.DownloadURL)">
Upvotes: 6