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]: REMOVE[Next]: Version9X
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Windows Installer FAQ (the basics)->Properties->Specific Properties->SourceDir

SourceDir

During an install this property points to the directory the MSI is being installed from. It is not normally available during other maintenance type operations unless the standard "ResolveSource" action has been executed.

It is best to avoid the use of "SourceDir" whenever possible as the "ResolveSource" custom action will require that the original MSI be available during maintenance operations, if it is missing then a very ugly and unfriendly Windows Installer dialog will be displayed (see "Source Availability" for more information).

Note that you may require the "SourceDir" to be available depending on chosen options if you have used the "MsiExtraFiles" command.

Please see Microsoft's online documentation for the "SourceDir" property (or "MSI.CHM") for more information.

COMPANY.MMH Support

The following shows some available options plus a code fragment from "COMPANY.MMH":

;----------------------------------------------------------------------------
;--- Add "ResolveSource" action ---------------------------------------------
;----------------------------------------------------------------------------
#define? COMPANY_INSERT_ResolveSourceAction  N
#if ['<$COMPANY_INSERT_ResolveSourceAction>' = 'Y']
    ;--- We do wish to insert the "ResolveSource" action --------------------
    #define COMPANY_RESOLVE_SOURCE_CONDITION   <$CONDITION_EXCEPT_UNINSTALL>
    #(
        #define ResolveSource           ;;Note that the SOURCE MSI MUST BE AVAILABLE (for example can't enter maintenance mode if MSI gone...)
        <$Table "{$#1}">
        #(
            ;--- Need to do this or "SourceDir" null if UI=none or basic --------
            #ifndef @@RsSeqNumber
                ;--- Only declare variable once ---------------------------------
                dim RsSeqNumber<?NewLine>
                #define @@RsSeqNumber
            #endif
            RsSeqNumber = GetSeqNumber("{$#1}", "CostInitialize-CostFinalize", 1)
            <$Row
                  Action="ResolveSource"                        ;;Set up the "sourceDir" property/directory
               Condition=^<$COMPANY_RESOLVE_SOURCE_CONDITION>^  ;;Don't want during uninstall etc (may require source media, CD etc)
               *Sequence=^RsSeqNumber^                          ;;Use Sequence number determined earlier
            >
        #)
        <$/Table>
    #)
    <$ResolveSource "InstallUISequence">
    <$ResolveSource "InstallExecuteSequence">
#endif

Please see the "options for commands" section of the manual.


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]: REMOVE[Next]: Version9X


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.