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]: MajorUpgrade[Next]: MergeModule
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->MapUserDir

The "MapUserDir" Command

This is a configuration command which you might use in a common header for all of your MSI files. It is used to set up mappings of user type directory names to something else, for example you can ensure that if you use "c:\program files" that this should be converted to "[ProgramFilesFolder]" instead.

The define "DIRMAP_STANDARD_MAPPINGS" defines some translations, you can replace or add to these if you wish.

This command takes these parameters:

Note that normally you are trying to map directories and so would terminate the "to" and "from" filenames with a slash, however you could map directories or partial directory names (for example "C:" to "D:").

The mappings are performed in order of definition and all are always applied.

Note that the directory names can be supplied in any case and only the start of a directory name is examined/modified.

EXAMPLE

This is the actual code used to configure MAKEMSI by default:

#( ''
   #define? DIRMAP_STANDARD_MAPPINGS

   ;--- Standard mappings ---------------------------------------------------
   <$MapUserDir "C:\Program Files\"    "[ProgramFilesFolder]\">
   <$MapUserDir "C:\Windows\"          "[WindowsFolder]\">
   <$MapUserDir "C:\WinNT\"            "[WindowsFolder]\">
   <$MapUserDir "C:\Windows\System32\" "[SystemFolder]\">
   <$MapUserDir "C:\WinNT\System32\"   "[SystemFolder]\">
#)


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: MajorUpgrade[Next]: MergeModule


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.