Join us for SoftSummit 2023. The 20th anniversary of the industry leading software monetization conference. April 18 and 20. Register Now

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

How to change INSTALLDIR depending upon operating system

Hi All,

I am creating installer which install our application in Program File folder. For that I set [INSTALLDIR] to ProgramFileFolder. It will waork fine for all OS. But now requirement is that if operating system is Windows Vista, application should get installed in AppDataFolder. For that purpose I have to change value of [INSTALLDIR] depending upon underlying OS. It should be AppDataFolder for Windows Vista and ProgramFilesFolder for all other OS.
Can anyone know how to sort out this issue?
Labels (1)
0 Kudos
1 Reply
Level 7

I'd use a type 51 (Set Property) custom action sequenced early enough in the sequence to assign [AppDataFolder] value as the value for [INSTALLDIR]. Just run this custom action in the case VersionNT is 600 (and to futureproof, set it to 600 or greater). This way also Windows Server 2008 will run the custom action, and this makes sense as Vista and Server 2008 are rather similar. However, if you want to run on Vista only, use also MsiNTProductType as a condition:
0 Kudos