Summary
How-To Example on getting MSI property from PowerShell script using InstallShield 2015 or newer
Synopsis
If you are using InstallShield 2015 or newer, you can use cmdlets, which will let you interact (get and set Windows Installer properties) with the running PowerShell custom action. This is a brief how-to and example getting and displaying a MSI Public Property using PowerShell .
Discussion
When you craft the sample below you can expect to see a message box display the content of the property you set in the Windows Installer Property Table.
Steps:
- Include/create a Windows Installer public property called MYPROPERTY in the Property Manager view.
- Add a value - some random string as the value of MYPROPERTY in the Property Manager view.
- In the view Custom Actions and Sequences include a New PowerShell custom action and click one of the following commands:
Stored in Binary table:To have your code base stored in the Binary table, select this command. This location is useful if you do not want the file to be installed on the target system. Installed with product: To call code from a script file that is going to be installed on the target system, select this command. - For this proof of concept (POC) schedule in the Install UI Sequence after CostFinalize.
- For this POC we are to use an empty .ps1 file. In the PowerShell Script File Name setting, select the PowerShell script file (.ps1) in the list of files that are stored in the Binary table or that are included in your project. If the location that you specified is stored in the Binary table, you can click this ellipsis button (...) in this setting to browse to the file.
- On the Script tab insert:
$VALUE = get-property -name MYPROPERTY [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [System.Windows.Forms.MessageBox]::Show($VALUE)
Related Documents
For more information see:
Related Articles
Launch an Executable Using a Custom Action 3Number of Views Windows Add/Remove Programs lists MongoDB 4.2.13 after Snow License Manager 9.27.1 upgrade 41Number of Views Hiding Confidential Information Stored in a Property from an MSI Log File 3Number of Views Launch a Custom Executable 16Number of Views Creating a Custom Action that Displays a Property 3Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago