Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run VBS as Install Custom Action Error

Status
Not open for further replies.

rhnewfie

Programmer
Jun 14, 2001
267
CA
Hey All

I have a vbs script that I want to run as a custom action when my solution installer runs. The script runs fine on it's own and updates the path of my PC but when the installer tries to run it it throws an error???? The error is visible in the event log stating that an object is required... WScript even though everything is declared.

Any thoughts would be apprecitated!!!

Dim WshShell
Dim WshPath
Dim strPath
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshPath = WshShell.Environment("System")
strPath = WshPath("Path")
strPath = strPath & "Path to Append"
WshShell.RegWrite "Reg Key to Update", strPath, "REG_EXPAND_SZ"

Product: ********** -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action _E35ED6C6_C660_497A_9692_CED84AE584E7 script error -2146827864, Microsoft VBScript runtime error: Object required: 'WScript'
 
WScript isn't declared.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
In any examples that I have seen it never seems to be declared. Am I missing something?
 
It is likely a namespace. Make sure you have the containing namespace Imported, or specify the full namespace.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
When a VBS runs as part of an insaller what permissions does it run under? Does it run under the logged in user? All users would have the permissions required to run this script but if it runs under something else then it might fail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top