\
Tips and Tricks
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