Take this example:
Code: Select all
# Block for declaring the script parameters.
Param($myProperty)
Add-Type -AssemblyName System.Windows.Forms
$propValue = AI_GetMsiProperty "$myProperty"
[System.Windows.Forms.MessageBox]::Show("The value of '$myProperty' is '$propValue' (within PowerShell before overwrite).", "PowerShellScriptInline")
AI_SetMsiProperty "$myProperty" "$propValue"
$propValue = "Changed Value"
[System.Windows.Forms.MessageBox]::Show("The value of '$myProperty' is '$propValue' (within PowerShell after overwrite).", "PowerShellScriptInline")
So I assume that MY_PROPERTY (already configured with "Install Parameters") is read-out and written-in by the PowerShell script.
However, when I use variables, the actual used (I assume) property name (1st parameter) is an empty string. When I hard-code the property into the 1st parameter it works.
The text output, however, shows that $myProperty is actually MY_PROPERTY.
I have attached the AIP file: