cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Naveed
Level 6

VBScript Custom Action Error

I have created a vbscript custom action which has this script

-----------------------------------------------------------------------
Set WshNetwork = WScript.CreateObject("WScript.Network")

WScript.Echo "User Name: " & WshNetwork.UserName & " User Domain: " & WshNetwork.UserDomain _
& " Computer Name: " & WshNetwork.ComputerName
-----------------------------------------------------------------------

When I double click it in .vbs file, It works correctly.
When I paste this script in vbscript custom action in InstallShield it gives error.

Any help, why is it happening?

Thanks,
Naveed
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

Windows Installer doesn't use WScript for VBScript actions, so for a start please replace WScript.CreateObject with just CreateObject. (For that matter, will the built-in LogonUser and ComputerName properties work for you, to help avoid a custom action?)
0 Kudos
Naveed
Level 6

Thanks for reply. I t solved my problem.

Are there any other differences in vbscript while writing a custom action in IS?
0 Kudos