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
- :
- Detect if VBScript / Scripting Host is enabled?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Sep 22, 2009
11:07 AM
Detect if VBScript / Scripting Host is enabled?
We use VBScript in Basic MSI installers. Occasionally we will encounter customer sites where the scripting host is not enabled. Sometimes the result is relatively beneign (e.g., using VBScript for some dialog validation), and sometimes it can be catastrophic (e.g., registry values partially calculated via VBScript are not correctly set).
Is there some way of detecting whether or not the scripting host is installed / active / enabled? If there is then I'm thinking I can use that as a Launch Condition for my installer and not even run if VBScript is not executable.
Thanks.
Is there some way of detecting whether or not the scripting host is installed / active / enabled? If there is then I'm thinking I can use that as a Launch Condition for my installer and not even run if VBScript is not executable.
Thanks.
(3) Replies
‎Sep 22, 2009
11:35 AM
I don't think there's likely to be a real sign of this. Sometimes it's an anti-virus system which blocks VBS, sometimes it's other problems. However if it consistently does or does not block VBS execution on a given machine, why not set a simple condition based on a simple property that a VB custom action should set. If the action can't run, it won't set the property, and your condition can trigger a clean abort.
‎Sep 23, 2009
07:35 AM
I'm with Michael on this one too.
Create a vbscript custom action to run early on with:
Session.Property("VBSCRIPTWORKING")
Don't forget to ignore exit code on your custom action
Then immediately follow with an error type custom action with it's condition set to Not VBSCRIPTWORKING.
By using an error custom action, your installer will abort and you'll get some decent logging
Create a vbscript custom action to run early on with:
Session.Property("VBSCRIPTWORKING")
Don't forget to ignore exit code on your custom action
Then immediately follow with an error type custom action with it's condition set to Not VBSCRIPTWORKING.
By using an error custom action, your installer will abort and you'll get some decent logging
‎Sep 23, 2009
06:47 PM
Thank you both. Sometimes we get so wrapped up in anticipating an "elegant" or "elaborate" solution that we ignore the simple or obvious. [In this case I'm using a royal "we" so that I don't feel like such a schmuck 🙂 ].
I have created a VBScript custom action which simply sets a property:
[FONT="Courier New"]Property("ISVBSCRIPTWORKING") = "True"[/FONT]
This CA is then sequenced prior to LaunchCondition, and I introduced a Launch Condition on ISVBSCRIPTWORKING.
So far I haven't been able to prove this revision corrects the issue - because I don't have access to the system on which this issue occurred. However, I have proved that it doesn't break my install in the normal course of events 🙂 .
As a side note, if VBScript.dll is not registered (which we have seen happen once in a while, but which was not the reason behind this post), Windows Installer itself will throw an error and terminate, "Error 2738. Could not access VBScript run time for custom action .", and we never get to the launch condition.
I have created a VBScript custom action which simply sets a property:
[FONT="Courier New"]Property("ISVBSCRIPTWORKING") = "True"[/FONT]
This CA is then sequenced prior to LaunchCondition, and I introduced a Launch Condition on ISVBSCRIPTWORKING.
So far I haven't been able to prove this revision corrects the issue - because I don't have access to the system on which this issue occurred. However, I have proved that it doesn't break my install in the normal course of events 🙂 .
As a side note, if VBScript.dll is not registered (which we have seen happen once in a while, but which was not the reason behind this post), Windows Installer itself will throw an error and terminate, "Error 2738. Could not access VBScript run time for custom action .", and we never get to the launch condition.