PDA

View Full Version : PowerShell Custom Action retrieve MSI Properties in Deferred Mode



DonAIR
02-10-2016, 12:27 PM
We are looking for a way to retrieve our MSI Properties in a custom PowerShell Action that runs in deferred mode. The properties are being set during the UI sequence (or silently) and the file gets copied to the local server and run. We were hoping to use something like get-property but that is returning blank.

OneDayBehind
11-29-2016, 10:36 AM
I think the answer to the question is "yes".

It took me a while to figure it out, but I am able to get the value of the INSTALLDIR property into a PowerShell script that runs in deferred execution. To do so, follow the standard steps for making a property accessible in deferred execution as described here (http://helpnet.flexerasoftware.com/installshield20helplib/Content/helplibrary/AccessingProps-DeferredCAs.htm). For Step 3., using the following PowerShell command to get the property you are looking for:


$value = Get-Property -Name CustomDataAction

Note that the "name" part of the PowerShell command is not INSTALLDIR as one might think.

The next challenge is to figure-out if it's possible to pass more than one property via the CustomDataAction variable. So far, I've only passed the one INSTALLDIR variable... I'm not sure what would happen if I tried to pass more than that.

pmsatterlee
12-07-2016, 04:04 PM
I think the answer to the question is "yes".

It took me a while to figure it out, but I am able to get the value of the INSTALLDIR property into a PowerShell script that runs in deferred execution. To do so, follow the standard steps for making a property accessible in deferred execution as described here (http://helpnet.flexerasoftware.com/installshield20helplib/Content/helplibrary/AccessingProps-DeferredCAs.htm). For Step 3., using the following PowerShell command to get the property you are looking for:


$value = Get-Property -Name CustomDataAction

Note that the "name" part of the PowerShell command is not INSTALLDIR as one might think.

The next challenge is to figure-out if it's possible to pass more than one property via the CustomDataAction variable. So far, I've only passed the one INSTALLDIR variable... I'm not sure what would happen if I tried to pass more than that.

You can set the CustomActionData for one LONG continuous stream of information delimited by ";" and the run a FOR loop to break it back down in to an array. I have done this in the past with VBScript which I am now trying to convert to PowerShell.

chad.petersen
12-16-2016, 02:36 PM
Make sure your properties being set are in ALL UPPERCASE or they will not survive from the UISequence to the ExecuteSequence.