I'm trying to implement automatic version control so that when creating my Bootstrapper, both versions of MyApp and Bootstrapper will automatically increase and synchronize. Otherwise, you will get duplicate boot records in add / remove programs for each installation attempt with the corresponding versions.
When I create a bootstrapper, the AfterBuild target uses GetAssemblyIdentity to get the automatically generated version of MyApp successfully, and the output file of the boot file is correctly named with an extension version number, for example. MyApp.1.0.5123.1352.exe
But, when I install this Bootstrapper, the version that appears in add / remove programs is always 1.0.0.0 .
I tried using the bindings in the Bootstrapper Bundle Version field, but I cannot get it to read the MyApp version.
Using !(bind.packageVersion.MyApp) causes it to never increase by 1.0.0.0.
Using !(bind.assemblyName.MyApp) leads to build errors (unresolved bind-time variable).
Using !(bind.FileVersion.filAAF013CA9B89B07C81031AE69884BF11) leads to build errors (unresolved bind variable). <- it makes sense because FileID exists in the Setup project, and this is the Bootstrapper project.
What can I do to make my Bootstrapper Bundle package have the same version as MyApp it packs?
===== MyApp \ AssemblyInfo.cs =====
[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.*")]
===== Setup.wixproj =====
<Target Name="BeforeBuild"> <PropertyGroup> <LinkerBaseInputPaths>..\MyApp\bin\$(Configuration)\</LinkerBaseInputPaths> </PropertyGroup> <HeatDirectory OutputFile="MyApp_Files.wxs" Directory="..\MyApp\bin\$(Configuration)\" DirectoryRefId="INSTALLLOCATION" ComponentGroupName="MyApp_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.PackageThisProject)'=='True'" /> </Target>
===== Bootstrapper.wixproj =====
<Target Name="AfterBuild"> <GetAssemblyIdentity AssemblyFiles="..\MyApp\bin\$(Configuration)\MyApp.exe"> <Output TaskParameter="Assemblies" ItemName="AssemblyVersion" /> </GetAssemblyIdentity> <Copy SourceFiles=".\bin\$(Configuration)\$(OutputName).exe" DestinationFiles=".\bin\$(Configuration)\MyApp.%(AssemblyVersion.Version).exe" /> <Delete Files=".\bin\$(Configuration)\$(OutputName).exe" /> </Target>
===== Bootstrapper \ Bundle.wxs =====
<Bundle Name="$(var.ProductName) Bootstrapper v!(bind.packageVersion.MyApp)" Version="!(bind.packageVersion.MyApp)"