Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Setup / November 2003

Tip: Looking for answers? Try searching our database.

Wscript object empty during setup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
waldyn.benbenek@unisys.com - 19 Nov 2003 16:41 GMT
I have added a vbscript to be run as a custom action during installation.
The script runs fine on its own, but when run as part the of the setup, the
WScript object is always empty.  According to the documentation, this object
cannot be instantiated(created) deliberately and is supposed to be always
avaiable.

Has anyone else run into this?  Does anyone know of a solution?

Wally
Felix Wang - 20 Nov 2003 07:22 GMT
Hi Wally,

Thanks for posting. The Windows Installer Platform SDK explains the issue
as below:

"The installer runs script custom actions directly and does not use the
Windows Script Host. The WScript object cannot be used inside a script
custom action because this object is provided by 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."

As a result, we may use the following to access WScript.Shell:

Dim wshell

Set wshell = CreateObject("WScript.Shell")

I hope this helps.

Regards,

Felix Wang
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

waldyn.benbenek@unisys.com - 20 Nov 2003 19:25 GMT
Thanks for your response.  So how, then, does one pass data to the script?
There is a field to pass data in the project.  How does the script pick it
up?
> Hi Wally,
>
[quoted text clipped - 25 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
Felix Wang - 21 Nov 2003 01:45 GMT
Hi Wally,

Thanks for the quick response.

If we author the MSI with VS.Net, to access the CustomActionData in a VBS
custom action, we can use the following:

Dim CAD
CAD = Property("CustomActionData")
MsgBox(CAD)

The string CAD will contain the CustomActionData input.

If you have any further cocerns regarding this issue, please feel free to
post here.

Regards,

Felix Wang
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.