Symptoms
This article explains how to use a PowerShell and VBS custom action to access an INSTALLDIR property using custom action. This information applies to the following InstallShield project types:
- Basic MSI
- InstallScript MSI
Solution
For PowerShell CustomAction:
- Create a Basic MSI Project.
- Open the CustomAction view.
- Add a set property CustomAction and rename it to
SetPropertyCA. - Property Name
SETCUSTOMINSTALLDIRand value set to[INSTALLDIR]. - Set InstallExec to After AppSearch.
- Create a PowerShell CustomAction with stored in Binary table.
- Browse and add the
.ps1file (save below code asTest.ps1).$Path = get-property -name SETCUSTOMINSTALLDIR $wshell = New-Object -ComObject Wscript.Shell New-Item $Path -ItemType "Directory" $a = new-object -comobject wscript.shell $b = $a.popup("INSTALLDIR: $Path",0,"Test Message Box",1) #[System.Windows.MessageBox]::Show('Would you like to Install the Setup?','Setup input','YesNoCancel','Error') #$msgBoxInput = [System.Windows.MessageBox]::Show($Path,'Game input','YesNoCancel','Error') Start-Process -FilePath $Path\Notepad2.exe - Set InstallExec to After SetPropertyCA.
- Save the project.
- Build and run the project.
VBS CustomAction:
- Create a Basic MSI Project.
- Open the CustomAction view.
- Add a VBS Custom Action with stored in binary table option.
- Browse and add your
.vbsfile (save below.vbsfile asinstalldir.vbs):Function InstallDIRTest() Dim INSTALLDIR, SRCDIR ' first, path to the msi file INSTALLDIR = Session.Property("INSTALLDIR") 'MsgBox Session.Property("INSTALLDIR") MsgBox "The value of INSTALLDIR is now " & session.Property("INSTALLDIR") End Function ' InstallMySQL - Set InstallExec to After InstallInitialize.
- Set the Use 64 bit scripting option to YES.
- Save the project.
- Build and run the project.
Reference
See the following:
Was this helpful?
Related Articles
Automatically Set INSTALLDIR to the Same Value for Base Version and Major Upgrade 21Number of Views What is the difference between the Workflow Manager File Share and AdminStudio Software Repository? 6Number of Views Filter is not applied when the full enterprise structure path is entered in the Location/Cost Center/Business Unit column … 4Number of Views Major upgrade leaves old entry in Add Remove Programs 26Number of Views Display of Suite Controls Based on Feature Selection 8Number of Views
Revenera Assistant
Online
Hi, I am Reva - Ask me anything.
Updates
No new updates
Chat
Home
Updates
/**/
Thanks for the feedback!
Your feedback has been saved.Rate this response:
1
2
3
4
5
Add Additional feedback ( Optional )
0/240
English
English
Language changed successfully
Something went wrong
Email sent successfully
Something went wrong
Case create successfully
Are you sure you want to cancel
the case creation?
Please select a product to submit the case.
Please select a product version to submit the case.
0/255
Upload Attachment
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to cancel the case creation?
Case closed successfully
File Upload
Maximum file size allowed is 3 MB.
File type not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
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. | |
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Revenera Assistant
© 2026 Flexera Software. All Rights Reserved.
Case id: 00001065
Activity: Status change: 2 hours ago