0

I have a VisualStudio 2012 solution, consisting of a bunch of C++ projects, each with a Debug / Release configuration and x64 / Win32 platforms. So I end up with four executables:

  • Debug-Win32.exe
  • Debug-x64.exe
  • Release-Win32.exe
  • Release-x64.exe

Of those, I use a WiX project to create installers from the *Release configuration output:

  • Release-Win32.exe -> Installer-Win32.msi
  • Release-x64-exe -> Installer-x64.msi

I then have a WiX burn bootstrapper project to chain those into a single bootstrapper executable. The bootstrapper selects the correct MSI to run for the platform.

My problem is that the bootstrapper project is dependent on both, the Win32 and x64 target platform of the installer project.

Right now, I need to manually trigger the build of those platform configurations before building the bootstrapper. Is there a way (by hand-editing the msbuild script) to create a build dependency on two target platform configurations?

Daniel Gehriger
  • 7,339
  • 2
  • 34
  • 55

1 Answers1

1

In the MSBUILD file (TFSBuild.proj) add both the flavors to build and that will solve the issue.

<ConfigurationToBuild Include="Release|Win32">
  <FlavorToBuild>Release</FlavorToBuild>
  <PlatformToBuild>Win32</PlatformToBuild>
</ConfigurationToBuild>
<ConfigurationToBuild Include="Release|x64">
  <FlavorToBuild>Release</FlavorToBuild>
  <PlatformToBuild>x64</PlatformToBuild>
</ConfigurationToBuild>

This will make sure that your application will be built on both the flavors and the output (MSI or exe) should be present in the appropriate folders. Your burn package can grab it from the folders.

Isaiah4110
  • 9,855
  • 1
  • 40
  • 56
  • Thanks AG_85 - but I'm only using a VisualStudio solution, not TFS. Is it possible w/o TFS? – Daniel Gehriger Nov 19 '12 at 16:52
  • Easiest would be to use the TFS and create a build definition if you have the infrastructure and server setup. or else you can create a small batch file which compiles your solution in both the flavors. – Isaiah4110 Nov 19 '12 at 18:39
  • 1
    msbuild "\Source\*.sln" /t:clean;rebuild /p:configuration=Release /p:Platform="win32" /l:FileLogger,Microsoft.Build.Engine;logfile=build.log msbuild "\Source\*.sln" /t:clean;rebuild /p:configuration=Release /p:Platform="x64" /l:FileLogger,Microsoft.Build.Engine;logfile=build.log – Isaiah4110 Nov 19 '12 at 18:47
  • First you compile your project for both the flavors you need and then kick off another MSBUILD command to build your WIX project. Like I said earlier, you can easily achieve this if you have TFS, just have to create one single build definition. – Isaiah4110 Nov 19 '12 at 18:49
  • ok, thanks. Maybe I should look into TFS. I'll keep the question open for some more time to see if there are any other suggestions. Otherwise, I'll accept your answer. – Daniel Gehriger Nov 19 '12 at 20:09
  • Sounds good! I will watch for other answers, that will help meas well. – Isaiah4110 Nov 19 '12 at 21:00
  • I've found that its more practical to just produce two separate installers for x86 and x64. I use the 'batch build' feature to build all my targets in one go. It doesn't stretch the users too much to have to pick the right download and I put in launch conditions so they won't run on the wrong platform. – Tim Long Dec 22 '12 at 09:47