cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ramakantk
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
IlkkaV
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: http://msdn.microsoft.com/en-us/library/aa370329.aspx
0 Kudos