Orad SA
Orad SA

Reputation: 1915

Multiple build configuration in Advanced Installer

I am using Advanced Installer with Visual Studio 2010. I managed to create an .aip project, but when I want to add the files from the relevant VS projects, I have to choose the exact location of these files.

I want to use more then one build configuration so I can use config transforms to change my .config files depend on the build configuration I choose.

This is a problem for me because when I compile in Debug the .exe & .dll files goes to bin\Debug, but when I compile in, lets say, Staging these files goes to bin\Staging.

How can I get Advanced Installer to get the right files, meaning get them from the target folder of the build configuration I chosen?

Upvotes: 3

Views: 1231

Answers (1)

Bogdan Mitrache
Bogdan Mitrache

Reputation: 11023

Advanced Installer does not support this by default, but with a little bit of tweaking you can get this working. Let me explain how:

  1. the first requirement is to have your output folders generated by VS in the same parent folder, as you have them both placed in "bin\".
  2. now you need to open your project in Advanced Installer GUI and do the following:
  3. create two builds in Media page, called Debug and Staging
  4. create a property called "Configuration" or what name would you like, from Install Parameters page
  5. in the New Property dialog you will have options to set per-build values for your property. Set them to "Debug" and "Staging", i.e. the names of the folders created by VS
  6. now go to File -> Options -> Path Variables and define a new path variable with your full path for the debug/staging, the one you current have in the project.
  7. from the Home tab, in the toolbar, use the "Convert Paths" wizard and then save the project.

Now, it comes the tricky part, you will need to edit the project file in a text editor, like Notepad++, capable of saving the file in UTF-8 format. Once you open the file look for this XML node:

 <COMPONENT cid="caphyon.advinst.msicomp.AppPathsComponent">
<ROW Name="BIN_DIR" Path="<your path>\bin\Debug" Type="2" Content="0"/>

You might have multiple variables here if you are already using this feature. You need to edit the value and replace "Debug" with "[|Configuration]".

Now you can save and build the project and it should pickup the correct files for each of the two builds.

Upvotes: 1

Related Questions