This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Pass arguments from InstallShield to VBS
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 14, 2010
11:27 AM
Pass arguments from InstallShield to VBS
Dear All,
I have a VBScript program that should be called from Custom Action. And I
failed to find a way to pass some parameters to it.
I have this custom action in Deferred Execution in system context:
Filename&Command Line:." "[INSTALLDIR]MyFolderVazio\RunVBS.vbs" "[INSTALLDIR]" "
I have this vbs:
Set args = WScript.Arguments
arg1 = args.Item(0)
MsgBox ""+arg1+ " "
Help please.
Thanks
I have a VBScript program that should be called from Custom Action. And I
failed to find a way to pass some parameters to it.
I have this custom action in Deferred Execution in system context:
Filename&Command Line:." "[INSTALLDIR]MyFolderVazio\RunVBS.vbs" "[INSTALLDIR]" "
I have this vbs:
Set args = WScript.Arguments
arg1 = args.Item(0)
MsgBox ""+arg1+ " "
Help please.
Thanks
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 30, 2010
11:57 AM
What is currently displayed by your message box currently? I assume that you are able to at least display something hard-coded such as "Hello world" successfully?
I think you should be able to pass [INSTALLDIR] on the command line to your vbscript script that you are installing with your product.
I think you should be able to pass [INSTALLDIR] on the command line to your vbscript script that you are installing with your product.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 30, 2010
12:56 PM
Since you are using a deferred custom action, you need to use the CustomActionData property to access the INSTALLDIR property. Please refer to Accessing or Setting Windows Installer Properties Through Deferred, Commit, and Rollback Custom Actions help topic for more information. There is also a sample VBScript code to access the CustomActionData property in this community forum.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 22, 2010
06:25 PM
Also - as I recall you cannot access the WScript methods directly in any CA, though you can create object methods.
So
Set WshShell=CreateObject("WScript.Shell")
Is perfectly OK, however
Set args = WScript.Arguments
is not valid in a CA. Unfortunately that means you simply cannot use it.
Another way to do this might be to set a session property to the value you want to use inside the vb script then access it through
Arg = Session.Property("YourSessionPropertyName")
You will need two custom actions - one that sets the session property you want to pass in, and then the custom action with the vbscript.
So
Set WshShell=CreateObject("WScript.Shell")
Is perfectly OK, however
Set args = WScript.Arguments
is not valid in a CA. Unfortunately that means you simply cannot use it.
Another way to do this might be to set a session property to the value you want to use inside the vb script then access it through
Arg = Session.Property("YourSessionPropertyName")
You will need two custom actions - one that sets the session property you want to pass in, and then the custom action with the vbscript.