views:

433

answers:

1

I have an Web Setup Project Installer and I would like to default the site and the Application Pool that is selected during the install process. Also I would like to have the name of the product append the current version number during the build process of the installer.

Any help would be greatly appreciated! Thank you

+5  A: 

Hi,

The Visual Studio Web Setup Project is quite a simple (and not too flexible) tool. You have some options, though (assuming you are not ready to switch to using something more flexible such as WiX or a commercial installation packaging product).

Modify the MSI After Building

One way to do what you want is to modify the MSI file after it has been built.

You can add properties such as the following:

  1. Add a property named TARGETSITE and set it to the metabase path of the site you need to be the default. For example, /LM/W3SVC/2.

  2. Add a property named TARGETAPPPOOL and set it to the name of the application pool you need to be the default. For example, MyAppPool.

  3. You can also set the product name by editing the existing ProductName property.

Making changes to MSI files can be achieved manually with tools such as InstEdit or ORCA (which is part of the Windows SDK).

Alternatively, you can create/find MSBuild tasks to get and set properties in MSI files. This gives you a nice way to automatically make the desired changes during automated builds.

Invoke with Commandline Arguments

More simply, you can invoke the installation from the command-line using msiexec.exe and specifying values for the TARGETSITE and TARGETAPPPOOL properties, for example:

msiexec /i MySetup.msi TARGETSITE=/LM/W3SVC/2 TARGETAPPPOOL=Pool2

You can't mess about with the ProductName this way, though.

Dave Cluderay
You may also use the MSI API (http://msdn.microsoft.com/en-us/library/aa369426(VS.85).aspx) to automate the changes as part of the build process.You can get a nice jscript sample that uses the MSI API from here (tweak accordingly): http://blogs.msdn.com/astebner/archive/2006/10/23/mailbag-how-to-set-the-noimpersonate-flag-for-a-custom-action-in-visual-studio-2005.aspx
Kevin Pullin
I forgot to mention JScript/VBScript - thanks.
Dave Cluderay
Thank you VERY much for your response Dave and Kevin.
Nic

related questions