visual-studio-2010installationinstallation-path

Conditional installation path based on target OS


I am creating a visual studio set up project to be installed on XP, Vista and Windows 7. In order for my program to be installed successfully on Vista and Seven, it needs to be installed in:

c:\ProgramData

I pointed the installation path of Application Folder as follow default location:

[CommonAppDataFolder][Manufacturer]\[ProductName] 

and as the condition I put:

VersionNT>=600

However, I want my program to be installed in:

c:\programfiles\Manufacturer

... for XP. I added a special folder which was pointing to ProgramFilesFolder and in the condition I put:

VersionNT<600

However it seems this condition is not being checked and it always tries to install in *C:\Documents and Settings\All Users\Application Data\mySoftware* for XP.

I am not sure if I am missing anything here. I really appreciate any help and suggestion.


Solution

  • This is not supported by Visual Studio setup projects, but it can be done with other setup authoring tools. The general approach is this:

    This way your package will use the Windows 7 install path by default and the XP path only when your custom action is executed.