cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
scooley
Level 2

CommonAppDataFolder

We use InstallShield 2012 with the .ism install script. We install our product on XP, Windows 2000, Windows 7, Server 2003 and Server 2008R2.

How do I populate the value of the CommonAppDataFolder from the OS I'm installing on to be used inside the .ism script?

I see a function GetCommonAppDataFolder already exists but do not see any instructions on how to us it.

Searching the Help index doesn't provide any examples of how to get the CommonAppDataFolder value.

Thank you for any assistance.
SFC
Labels (1)
0 Kudos
(2) Replies
rrinblue22
Level 9

Have you tried using FOLDER_COMMON_APPDATA in InstallScript?

this should work in your case.
0 Kudos
Shuttledude
Level 7

If you are simply trying to install certain files to a subdirectory under the CommonAppDataFolder then of course you could just put those files in a component whose Destination value is:
[CommonAppDataFolder]MyProduct\MyFiles

But if you want to define a string value that equates to the value of the CommonAppDataFolder, you could use SysInfo to just set that string yourself, based on what OS you're on. Use SYSINFO.nISOSL as described below (taken from online help). Based on the return value, just manually define the string to be the value you already know it would be on that OS. Not an elegant solution, but it would work.

Another way of using SysInfor to do this:


if (SYSINFO.WINNT.bWinXP) then
MessageBox("Installing on Windows XP",INFORMATION);
// set string value, e.g., strCmnApDatFldr = "...FullyDefinedValue..."
endif;


SYSINFO.nISOSL


Value indicates the operating system of the target machine. Possible values are the following:


•ISOSL_WIN95—Windows 95

•ISOSL_WIN98—Windows 98

•ISOSL_WINME—Windows Millennium Edition

•ISOSL_NT40—Windows NT 4.0

•ISOSL_WIN2000—Windows 2000

•ISOSL_WINXP—Windows XP Edition

•ISOSL_WINSERVER2003—Windows Server 2003

•ISOSL_WINVISTA—Note that Windows Vista and Windows Server “Longhorn” use the same major and minor version numbers. Therefore, if you want to use InstallScript to distinguish between Windows Server “Longhorn” and Windows Vista, check whether SYSINFO.nOSProductType = VER_NT_WORKSTATION; for Windows Vista, this is TRUE; for Windows Server “Longhorn,” it is FALSE.
0 Kudos