Summary
Running a VBScript file from within InstallScript code
Synopsis
This article explains how to execute a VBScript file from InstallScript.
Discussion
First include the VBScript file into the project.
- Open the Installation Designer view and under Behavior and Logic > Support Files/Billboards, select Support Files > Language Independent. The files included here are extracted to the location specified by the InstallScript variable, SUPPORTDIR.
- In the right-hand window, right click and choose Insert Files.
- Browse to the VBScript file to add to the setup, for example, mySample.vbs.
- Select the InstallScript node under Behavior and Logic, and go to step 5 below.
- Add the following sample script that finds the executable to pass the VBScript file ('mySample.vbs') to launch with a call to LaunchAppAndWait:
function OnBegin() string sWScript; begin FindFile(WINSYSDIR, "WScript.exe", sWScript); if sWScript != '' then LaunchAppAndWait(WINSYSDIR ^ "WScript.exe", SUPPORTDIR ^ "mySample.vbs", WAIT); endif; end;
NOTE: This is only a sample. You can call the above script from any InstallShield event, such as OnBegin or OnEnd, or a function that is called from an InstallShield event. All references to the VBScript file for this sample, mySample.vbs, should be substituted with the VBScript file to be launched from your setup script.
Additional Information
For information on how to include InstallScript in InstallScript MSI and Basic MSI projects, see the InstallShield Help Library topic Using InstallScript.
For further information about the Windows Script Host (Wscript.exe), refer to the following Microsoft articles:
Related Articles
Is it possible to convert VBscript to InstallScript? 4Number of Views The Installscript function MsiDoAction() does not correctly execute the custom action in the UI sequence of a Installscrip… 4Number of Views IsCabView.exe To View Log File From An InstallScript Installer 7Number of Views Setting or Getting the Value of a Property Via a VBScript Custom Action 5Number of Views Logging An InstallScript MSI Project 425Number 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. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago