cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jbiddle61
Level 4

How to use [ProductVersion] as part of the [INSTALLDIR]

In Visual Studio 2010, I could use [ProductVersion] as part of the [TARGETDIR].
In Visual Studio 2012, I cannot get this to work - it always creates the folder with the literal '[ProductVersion]' for the folder name instead of the value of the ProductVersion property.

Is there any way to get this to work, or do I need to find a different product for building my installs?
Labels (1)
0 Kudos
(5) Replies
jbiddle61
Level 4

For those who need to do the same thing, here is the VBScript to do it.
NOTE that the file must be in ASCII encoding and NOT UTF-8!

Dim installdir
installdir = Session.Property("INSTALLDIR")

Dim version
version = Session.Property("ProductVersion")

Session.Property("INSTALLDIR") = installdir & version


Note: The reason for this is so we can install the new version of the app on our terminal server while others are still using the current version.
We have a custom 'app launcher' that executes the most recent version of the app.
0 Kudos
TsungH
Level 12

Keep in mind that, by using ProductVersion in component destination and custom action to update component destination during installation, it will incur additional work to ensure proper upgrade and clean uninstallation (esp after upgrade).
0 Kudos
jbiddle61
Level 4

Care to elaborate on what 'extra work' is required and when?
Do you have a better way to do this?

In VS2010, I could just set the DefaultLocation property of the Application Folder to [ProgramFilesFolder][Manufacturer]\[ProductName]\[ProductVersion].

Why did Flexera chose to remove that capability in VS2012?
0 Kudos
TsungH
Level 12

Say ProductVersion changes from 1.0.0 to 1.0.1, the destination will change. With component GUID unchanged, components remain installed, files in components will go to a different folder. During uninstallation, it will somehow know what to remove. The "somehow" part is the additional work. I would not want to use ProductVersion as part of destination path, unless it is to support coexistence of multiple versions of the same product. To truly implement coexistence, a lot more will need to be changed, component GUIDs, binary CLSID/AppID/TypyLib etc.
0 Kudos
jbiddle61
Level 4

As I said in the previous post, this IS to allow multiple versions of the product to be installed at the same time.
Why Oh Why did Flexera lobotomize this product?
In VS2010, when I changed the Product Version property, it would ask me if I wanted to also change the Product Code GUID.
Of course, like everything else that used to work in VS2010, this also does not work in VS2012.
0 Kudos