MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Operating System Properties[Next]: Specific Properties
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Windows Installer Basics->Properties->System Folder Properties

System Folder Properties

Windows Installer defines some standard directory names which provide aliases to "special" folders. A list of these is provided below, for more generic Windows Installer information on any of these see the properties "System Folder Properties" page online.

Installing any MSI while generating a verbose log will create a text file which lists all available folder properties and their current values. You can use this to "prove" the value you believe you require.

You can use these values in "INI" files or "registry" etc by using a formatted value such as "[ProgramFilesFolder]" and note that the value always ends with a slash! If you don't want the slash you will need to write a custom action" to remove it.

The "DirectoryTree" and some other MAKEMSI commands allow you to specify directories and their parent directories (something Windows Installer doesn't do), so for example you could install into the directory "c:\program files\a\b\c\Install Here".

In general it is a bad idea to hard code something like "c:\program files" as Windows Installer defines the system folder property "ProgramFilesFolder" for this purpose. Please understand that "c:\program files" is only a default location which can be somewhere else on a different computer!

In actual fact with MAKEMSI's default configuration the hard coded value is "automatically mapped" to the correct system folder property (if you didn't want to do this you'd need to remove the mapping or work around it).

Example System Folder Properties

Click on any of the properties below to see Microsoft's documentation for that directory property. Note that these properties were captured during a per-machine and per-user install (note that on this machine "c:\dbareis" is "My Documents").

System Property per-machine Example per-user Example
AdminToolsFolder C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools\ C:\Documents and Settings\Dennis\Start Menu\Programs\Administrative Tools\
AppDataFolder As for per-user C:\Documents and Settings\Dennis\Application Data\
CommonAppDataFolder C:\Documents and Settings\All Users\Application Data\ As for per-machine
CommonFiles64Folder
(see "64 Bit Installs")
no sample available no sample available
CommonFilesFolder C:\Program Files\Common Files\ As for per-machine
DesktopFolder C:\Documents and Settings\All Users\Desktop\ C:\Documents and Settings\Dennis\Desktop\
FavoritesFolder As for per-user C:\Documents and Settings\Dennis\Favorites\
FontsFolder C:\WINDOWS\Fonts\ As for per-machine
LocalAppDataFolder As for per-user C:\Documents and Settings\Dennis\Local Settings\Application Data\
MyPicturesFolder As for per-user C:\DBAREIS\My Pictures\
PersonalFolder As for per-user C:\DBAREIS\
ProgramFiles64Folder
(see "64 Bit Installs")
no sample available no sample available
ProgramFilesFolder C:\Program Files\ As for per-machine
ProgramMenuFolder C:\Documents and Settings\All Users\Start Menu\Programs\ C:\Documents and Settings\Dennis\Start Menu\Programs\
SendToFolder As for per-user C:\Documents and Settings\Dennis\SendTo\
StartMenuFolder C:\Documents and Settings\All Users\Start Menu\ C:\Documents and Settings\Dennis\Start Menu\
StartupFolder C:\Documents and Settings\All Users\Start Menu\Programs\Startup\ C:\Documents and Settings\Dennis\Start Menu\Programs\Startup\
System16Folder C:\WINDOWS\system\ As for per-machine
System64Folder
(see "64 Bit Installs")
no sample available no sample available
SystemFolder C:\WINDOWS\system32\ As for per-machine
TempFolder As for per-user C:\DOCUME~1\Dennis\LOCALS~1\Temp\
TemplateFolder C:\Documents and Settings\All Users\Templates\ C:\Documents and Settings\Dennis\Templates\
WindowsFolder C:\WINDOWS\ As for per-machine
WindowsVolume C:\ As for per-machine

How to use WindowsFolder

The "WindowsFolder" name (and possibly others) are not allowed as a directory parent, this code shows a workaround:

<$Directory Key="WINDOWS_VOLUME" Parent="<$AnyDir>" DIR="AnyThing">
<$PropertyCa "WINDOWS_VOLUME" Value="[WindowsVolume]" SEQ="1-" Type="FirstSequence" SeqTable="InstallExecuteSequence InstallUISequence">

<$DirectoryTree Key="OffWindowsVolume" DIR="[WINDOWS_VOLUME]\oracle">
<$Files "TryMe.mm" DestDir="OffWindowsVolume">

I created the "WINDOWS_VOLUME" directory entry whose details don't matter and get overriden via the custom action to contain the value of "WindowsFolder". If you wanted to be able to override it from the command line you'd want to add a condition to the custom action.

Standard Windows Folder Environment Variables

Windows has these standard environment variables, these should have Windows Installer equivalants (but could in some cases also be directly used):

Environment Variable Example Value
ALLUSERSPROFILE C:\Documents and Settings\All Users
APPDATA C:\Documents and Settings\Dennis\Application Data
CommonProgramFiles C:\Program Files\Common Files
HOMEDRIVE C:
HOMEPATH \Documents and Settings\Dennis
ProgramFiles C:\Program Files
SystemDrive C:
SystemRoot C:\WINDOWS
WinDir C:\WINDOWS


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 15 Nov 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Operating System Properties[Next]: Specific Properties


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday November 15 2008 at 2:05pm
Visit MAKEMSI's Home PageThis external link was OK when tested at 7 Nov 2008

HTML page dated Mon, 29 Jan 2007 00:11:11 GMT
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 15 Nov 2008