views:

293

answers:

2

I have a Visual Studio Setup project which has a Application Folder DefaultLocation set to[ProgramFilesFolder][Manufacturer]\[ProductName]. I would like to change this to include the software's version number, like [ProgramFilesFolder][Manufacturer]\[ProductName][Version], but Visual Studio doesn't seem to support it.

Is there an alternative to manually changing the Application Folder's DefaultLocation every time I create a new release?

A: 

The way I would do it is create a post-build event, that runs a Javascript program that modifies the MSI. It should be a pretty simple thing.

There's a sample script that modifies an MSI in the answers to the question
How to run an EXE after MSI installation?

That script doesn't do what you want but using Orca and that script, you should be able to figure out how to create your own, that modifies the MSI to insert the version number automatically.

It should be a single db update.

Cheeso
Wait... Javascript...? Seriously?
emddudley
yep! why? you think it's not a "real" programming language or something? scripting is a key piece of any platform.
Cheeso
A: 

You can use [ProductVersion] in the same way as [ProductName] and set product's version in the project's properties window.

Leo