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

The "Property" Command

This command is used to create or update the value of a Windows Installer property.

If you wish to have the property set at a specific time (to capture the "current" value of properties etc) you should use the "PropertyCa" command instead.

This command takes these parameters:

Main Property Related Options

Please see the "options for commands" section of the manual.

#define? DEFAULT_PROPERTY_PERSIST_HOW                             ;;HK?? VERSION UI_REMOVE
#define? PROPERTY_PERSIST_ROOT_LOCATION               <$MAKEMSI_BASE_REGISTRY_KEY>\PersistingProperties
#define? PROPERTY_PERSIST_PRODUCT_LOCATION            <$PROPERTY_PERSIST_ROOT_LOCATION>\<$ProdInfo.Productname>
#define? PROPERTY_PERSIST_PRODUCT_VERSION_LOCATION    <$PROPERTY_PERSIST_PRODUCT_LOCATION>\<$ProductVersion>
#define? PROPERTY_PERSIST_SHARED_ROOT_LOCATION        <$PROPERTY_PERSIST_ROOT_LOCATION>\$Shared$              ;;You could redefine to include your company details (to ensure uniqueness)
#define? PROPERTY_PERSIST_DOCUMENT_REGISTRY_IN_HTML   N             ;;Show in HTML report (Y/N)?
#define? PROPERTY_PERSIST_COMPONENT_ATTRIBUTES        LocalOnly
#define? PROPERTY_PERSIST_COMPONENT_PERMANENT         N             ;;Do values survive an uninstall? (1) "N" = NO (2) "A" or "Y" = via "permanent" component attribute or (3) "G" = Don't register GUID (won't repair though)
#define? DEFAULT_PROPERTY_PERSIST_OPTIONS4COMPONENT                 ;;Any options for autocreated components
#define? PROPERTYCA_DEFAULT_TYPE_ATTRIBUTES                         ;;You'll probably never need to change...

EXAMPLE - Simple

;--- Set a property ---------------------------------------------------------
<$Property "ROOTDRIVE" VALUE="C:\">

;--- Get "CustomField" from .VER product information ------------------------
<$Property "CustomField" VALUE="<$ProdInfo.CustomField>">

EXAMPLE - Remember Installation Directory

If you main installation directory is "INSTALLDIR" and you wish to remember where a user may have redirected this for all future installs of your product then you can use code similar to the following:

;--- Define the installation directory --------------------------------------
<$DirectoryTree Key="INSTALLDIR" Dir="[ProgramFilesFolder]\<$ProdInfo.ProductName>" CHANGE="\" MAKE="Y">

;--- Save/Restore the "INSTALLDIR" location ---------------------------------
<$Property "INSTALLDIR" Persist="Y" PersistHow="PRODUCT FOREVER">

;--- Example of using your own namespace ------------------------------------
<$Property "SharedProperty" Value="ItsShared" PERSIST="Y" PersistHow="LOCAL_MACHINE SHARED:MyCommon FOREVER">


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]: ProductValidation[Next]: PropertyCa


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.