Browsing the docs I found the Binder variables and one for
bind.assemblyVersion.FileID, it looks like I can't use it in the same way as
normal properties though as it gets evaluated after the WiX XML has been
parsed. Has anyone had any experience of using this?

I am trying to set a ProductVersion variable in my WiX file so I can show a
version in the installer and tie the installer up to a specific build.

Is there a preferred method for tying the source/assemblies/installer into
the same version?

 

Si suggested the following on a post earlier this year, it looks good but is
there a 'supported' way?

 

<Import
Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Ta
sks.Targets" 
/> 
<Target Name="BeforeBuild"> 
<ReadLinesFromFile File="..\Properties\AssemblyInfo.cs"> 
  <Output TaskParameter="Lines" 
                  ItemName="ProductAssemblyInfo"/> 
</ReadLinesFromFile> 
<RegexMatch Input="@(ProductAssemblyInfo)" 
                        Expression="AssemblyVersion"> 
  <Output ItemName="ProductAssemblyVersion" 
                  TaskParameter="Output" /> 
</RegexMatch> 
<FileUpdate Files="Config.wxi" 
                        Regex='define ProductVersion = 
"[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?"
' 
                        ReplacementText='define ProductVersion =
"@(ProductAssemblyVersion)"' /> 
<FileUpdate Files="Config.wxi" 
                        Regex='\[assembly: 
AssemblyVersion\(\"(?<version>[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-
9]?[0-9]?\.[0-9][0-9]?[0-9]?)\"\)\]' 
                        ReplacementText="${version}" /> 
</Target> 
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'"> 
<CreateItem Include="$(OutputPath)$(OutputName).msi"> 
  <Output ItemName="ReleaseFiles" TaskParameter="Include" /> 
</CreateItem> 
<Copy SourceFiles="@(ReleaseFiles)" 
DestinationFolder="$(OutputPath)..\..\..\..\..\..\..\Deploy\Setup" /> 
</Target>

 

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to