Windows Installer properties are global variables that Windows Installer uses during an installation. There are two main types of Windows Installer properties:
- Private Properties (contain lower-case letters in their name, example: My_Prop)
- Public Properties (contain only upper-case letters in their name, example: MY_PROP)
The difference between Public and Private properties consists in the way their values are being passed on. Only the value of a Public Property is passed on from the Wizard Dialogs Stage (in which the dialogs are showed) to the Install Execution Stage (in which the system is modified).
In order to get or set an installer property, you can use the following methods:
// getting a property MyVariable = session["MyProperty"]; // setting a property session["MyProperty"] = "MyValue";
To call a function from a dll, you can use the predefined Call function from attached native DLL custom action. For details, please check the Options to integrate and debug custom actions article with related information for hints and guidance.
// getting a property MsiGetProperty(aHandle, L"MyProperty", MyVariable, &propertySize); // setting a property MsiSetProperty(aHandle, L"MyProperty", MyVariable);
# getting a property $propValue = AI_GetMsiProperty MY_MSI_PROP # setting a property AI_SetMsiProperty MY_MSI_PROP "MyValue"
// getting a property MyVariable = Session.Property("MyProperty") // setting a property Session.Property("MyProperty") = "MyValue"