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

The "Directory" Command

This command creates a directory entry entry in the MSI "Directory" table. It basically creates a single directory at a time given the name of a parent. It can also be given a full directory name in which case it will assign it via a custom action. Generally a better way of defining directories is via the DirectoryTree command.

The macro takes these parameters:

Please note that this command doesn't validate parameters so if you mis-spell one it won't tell you... Sorry...

EXAMPLES

<$Directory KEY="AAA"        PARENT="ProgramFilesFolder" DIR="AAA">
<$Directory KEY="BBB"        PARENT="AAA"                DIR="BBB">
<$Directory Key="DIR83"      PARENT="AAA"                DIR="AN83NAME.1|ALongDirectoryNameForWhichIHaveSuppliedASpecific_8.3_Name">
<$Directory KEY="ZDRIVE_CCC" VALUE="Z:\CCC">

EXAMPLE - Create Alias to another directory

The following shows one way to create an alias to another directory (in this case a "system folder"):

<$Directory KEY="INSTALLDIR" PARENT="ProgramFilesFolder" DIR="." ASIS="Y" CHANGE=".">

EXAMPLE - Conditional Definition

The following demonstrates how to define a "Diagnostics" start menu folder so it gets created if required:

;--- Conditionally define the "Start->Programs->Diagnostics" menu (defined on demand) ---
<$Directory Key="SCDIR_DIAGNOSTICS" Conditional="@@SCDIR_DIAGNOSTICS">
#(
    ;--- Define how to create the "standard" diagnostics folder -------------
    #define @@SCDIR_DIAGNOSTICS

    <$Component "SCDIR_DIAGNOSTICS" Create="Y" Directory_="<$AnyDir>" LM="Y">
         <$DirectoryTree Key="SCDIR_DIAGNOSTICS" Dir="[ProgramMenuFolder]\Diagnostics" MAKE="Y" REMOVE="Y">
    <$/Component>
#)

The above code will only get created when the directory key "SCDIR_DIAGNOSTICS" is first used.


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]: DialogRemove[Next]: DirectoryCompress


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.