cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
paul_wilson
Level 3

PowerShell Custom Action - ComboBox Values

Hey,

Could I ask if someone can give us a quick example of how to populate the Value within a ComboBox from a PowerShell custom action?
Basic MSI install - PowerShell custom action.

I can use this just fine..

set-property -name AZURE_SUBSCRIPTION -value $obj.SubscriptionName

Which will update my property called AZURE_SUBSCRIPTION with the value of $obj.SubscriptionName

But that's just a standard property. ComboBoxes use the "ComboBox" table and in there are Value and Text columns within that, so I'm guessing I need to update that table somehow?

Is this possible?

Thanks.
Labels (1)
0 Kudos
4 Replies
chad_petersen
Level 9

PowerShell? I'm not positive since I don't use PowerShell for custom actions, but here's an example using VB that you might be able to port over.

In a nutshell the MSI boils down to a relational database so you have to open the database and read/write to it.

' open and execute a view to the ComboBox table
Set oView = Session.Database.OpenView("SELECT * FROM `ComboBox`")
oView.Execute


http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-populate-a-list-box-in-a-msi-dialog-during-runtime-td3811329.html

It's not specific to InstalShield, but then neither is the ComboBox table.
0 Kudos
paul_wilson
Level 3

Actually that helped, it's lead me on to further realise you can't do it with PowerShell due to the way it interacts with the install session etc.
I will do it vbscript, thank you for your comment.

Regards,
Paul
0 Kudos
chad_petersen
Level 9

If that helped I'm am happy. I know sometimes it can be a relief not to keep beating ones head against a given wall - so we can turn and beat our heads against a different wall.

Cheers!

Chad
0 Kudos
Cary_R
Level 11

Hey Paul,

I just came across this thread and based on the few lines of sample code you are trying to do the same thing as me: Wire up Azure Powershell to an Install for some reason or another.


I'm writing my own Powershell support from scratch in Wix DTF however. Let's keep compare notes sometime!
0 Kudos