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: VB script not executing
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
‎Sep 26, 2011
09:23 PM
VB script not executing
I want to create a url shortcut in programme folder.
So i planned to write a vb script and pass it
custom action during installation>After setup complete Success dialogue.
Here is my VB script
set WshShell = WScript.CreateObject("WScript.Shell")
user=WshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
set oUrlLink = WshShell.CreateShortcut(user+ "\\Start Menu\\Programs\\yahoo" & "\yahoo.url")
oUrlLink.TargetPath = "http://yahoo.com/"
oUrlLink.Save
When i run this script manually it works perfect.
Can any body figure out where is problem.IS it is my script problem ot custom action or any thing else?
I also tried to add simple message box in my script but it does not pop.(Means script not execute)
But when i run example scrip from
http://kb.flexerasoftware.com/doc/Helpnet/isxhelp16_sp1/ISXVBSCAExample.htm
It works perfect in custom action.
thanks!
So i planned to write a vb script and pass it
custom action during installation>After setup complete Success dialogue.
Here is my VB script
set WshShell = WScript.CreateObject("WScript.Shell")
user=WshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
set oUrlLink = WshShell.CreateShortcut(user+ "\\Start Menu\\Programs\\yahoo" & "\yahoo.url")
oUrlLink.TargetPath = "http://yahoo.com/"
oUrlLink.Save
When i run this script manually it works perfect.
Can any body figure out where is problem.IS it is my script problem ot custom action or any thing else?
I also tried to add simple message box in my script but it does not pop.(Means script not execute)
But when i run example scrip from
http://kb.flexerasoftware.com/doc/Helpnet/isxhelp16_sp1/ISXVBSCAExample.htm
It works perfect in custom action.
thanks!
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2011
11:03 AM
Hello,
I see that you are using WScript Object in you script. The WScript object cannot be used inside a script custom action because this object is provided by the Windows Script Host. The Installer runs Script Custom Actions directly and does not use the Windows Script Host. Objects in the Windows Script Host object model can only be used in custom actions if Windows Script Host is installed on the computer by creating new instances of the object, with a call to CreateObject, and providing the ProgId of the object (for example "WScript.Shell"). Depending on the type of script custom action, access to some objects and methods of the Windows Script Host object model may be denied for security reasons.
Hence VBScript Custom Action is failing.
Thanks,
Bharath
I see that you are using WScript Object in you script. The WScript object cannot be used inside a script custom action because this object is provided by the Windows Script Host. The Installer runs Script Custom Actions directly and does not use the Windows Script Host. Objects in the Windows Script Host object model can only be used in custom actions if Windows Script Host is installed on the computer by creating new instances of the object, with a call to CreateObject, and providing the ProgId of the object (for example "WScript.Shell"). Depending on the type of script custom action, access to some objects and methods of the Windows Script Host object model may be denied for security reasons.
Hence VBScript Custom Action is failing.
Thanks,
Bharath
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2011
11:38 AM
Thanks Sir!
Then what changes to made in my script to do it wok!
Then what changes to made in my script to do it wok!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 29, 2011
10:43 AM
Hello,
Could you replace Wscript.CreateObject with CreateObject and check if the VBScript runs successfully.
For Example: Wscript.CreateObject("some.object", "Another-parameter") replace this with CreateObject("some.object", "Another-parameter")
Thanks,
Bharath
Could you replace Wscript.CreateObject with CreateObject and check if the VBScript runs successfully.
For Example: Wscript.CreateObject("some.object", "Another-parameter") replace this with CreateObject("some.object", "Another-parameter")
Thanks,
Bharath
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 30, 2011
09:51 PM
Thanks!
I create a c# programme to create url link.
And replace it instead of vb script.
It is working fine now!
I create a c# programme to create url link.
And replace it instead of vb script.
It is working fine now!
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)