|
![]() |
| The "RegistryRead" Command |
This command is used to "read" the value of a registry entry. The retrieved value is placed into a property specified by you.
The read is done via an "AppSearch" table
entry.
This command takes these parameters:
If not specified then the existance of the property will be validated (the install will fail if it does not exist).
This value can be "" to indicate that no validation should take place (the property is not set to null).
Due to Windows Installer restrictions you would also need to turn off validation if the existing registry values can contain empty strings (either that or prevent this if you control them by creating an empty "code").
The default signature is the property name so if you make this meaningful then you probably don't need to use this parameter (except in the case where you might be populating the same property from two or more sources).
| EXAMPLES |
This shows how you can work out if you are on a workstation or server, the result is placed into the property "WINDOWS_PRODUCT_TYPE" (as there is no defined "default" value the install will abort if the value doesn't exist):
;--- Read the value ------------------------
#(
<$RegistryRead
Property="WINDOWS_PRODUCT_TYPE"
HKEY="LOCAL_MACHINE"
Key="SYSTEM\CurrentControlSet\Control\ProductOptions"
Name="ProductType"
>
#)
;--- Display the result in a message box ---
<$VbsCa Binary="DisplayProperty.vbs">
<$VbsCaEntry "Install">
PropertyBox("<$VbsCaEntryName>")
<$/VbsCaEntry>
<$VbsCaEntry "UnInstall">
PropertyBox("<$VbsCaEntryName>")
<$/VbsCaEntry>
'=======================
sub PropertyBox(When)
'=======================
;--- Get the value of the MSI property ---------------
dim PropertiesValue : PropertiesValue = VbsCaPropertyGet("WINDOWS_PRODUCT_TYPE", "", "")
;--- Display when we were invoked + property value ---
CaMsgBox "I", "The " & When & "() routine was invoked." & vbCRLF & vbCRLF & "Property = " & PropertiesValue
end sub
<$/VbsCa>
<$VbsCaSetup Binary="DisplayProperty.vbs" Entry="Install" Seq="AppSearch-" Type="immediate" SeqTable="InstallUISequence" CONDITION=^<$VBSCA_CONDITION_INSTALL_ONLY>^>
![]() | ![]() |