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]: No Installation Registration
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 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 23 Aug 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: User Creation[Next]: No Installation Registration


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday August 30 2008 at 3:54pm
Visit MAKEMSI's Home PageThis external link was OK when tested at 28 Aug 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 23 Aug 2008