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]: RegistryImport[Next]: RemoveFile
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->RegistryRead

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:

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>^>


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 25 Jun 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: RegistryImport[Next]: RemoveFile


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday July 06 2008 at 11:25am
Visit MAKEMSI's Home PageThis external link was OK when tested at 21 Jun 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 25 Jun 2008