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]: User Creation[Next]: Testing Under the Local System Account
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->Query MSI Table Data

Query MSI Table Data

The following code queries the "Property" table and extracts a properties value. The code will fail if the query doesn't match any records or it it matches more than one:

dim UpgradeCode
<$Table "Property">
    ;--- Execute query, expect exactly one match (or abort) -----------------
    <$Row @Where="Property='UpgradeCode'" @OK=^? = 1^ @Code="Y">
         ;--- Extract details from row that matches the query ---------------
          UpgradeCode = <$COLSTR.Property.Value>
    <$/Row>
<$/Table>
'MsgBox "DEBUG: UpgradeCode=" & UpgradeCode

The following code (part of "UISAMPLE.MMH) updates the spelling of licence depending on your preference:

#if ['<$UISAMPLE_LICENCE_SPELLING_C_OR_S>' = 'c']
    ;--- We are changing spelling from "license" to "licence" ---------------
    #ifndef REMOVED_LicenseAgreementDlg
        <$Table "Control">
        #(
            ;--- Look at licence dialog rows ------------------------------------
            <$Row
                  @Where=^`Dialog_` = 'LicenseAgreementDlg'^
                @SelfRef="{*}"
                   *Text=^replace({*}, "icense", "icence")^
            >
        #)
        <$/Table>
    #endif
    <$Table "RadioButton">
    #(
        ;--- Look at all rows -----------------------------------------------
        <$Row
              @Where=^^
            @SelfRef="{*}"
               *Text=^replace({*}, "icense", "icence")^
        >
    #)
    <$/Table>
#endif


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]: User Creation[Next]: Testing Under the Local System Account


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.