Skip to content

Instantly share code, notes, and snippets.

@philcleveland
Created October 25, 2013 18:01
Show Gist options
  • Save philcleveland/7159081 to your computer and use it in GitHub Desktop.
Save philcleveland/7159081 to your computer and use it in GitHub Desktop.
Trying to pass variable from TFS to WiX
I have a Variable defined in my TFS Build template
Name:TFSGenProductVersion
Type:String
Scope:Sequence
Default:"3.1.2"
I added this to the wixproj
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>Debug;MyProductVersion=0.0.0.1</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>MyProductVersion=$(TFSGenProductVersion)</DefineConstants>
</PropertyGroup>
I added this to the wxs
<Product Id="B5F53C50-A6D9-4731-BE9B-AA3B7CF63366"
Name="MyApp"
Language="1033"
Version="$(var.MyProductVersion)"
Manufacturer="Me"
UpgradeCode="B7CE3354-C478-4E0B-8547-A83AC7F3F77C">
when TFS builds I get the following, so I know the variable is not being passed in.
..\Product.wxs (12): The Product/@Version attribute's value cannot be an empty string. If you want the value to be null or empty, simply remove the entire attribute.
..\Product.wxs (12): The Product/@Version attribute was not found; it is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment