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
- :
- VBScript Custom Action Error
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
‎Oct 14, 2009
11:12 AM
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
-----------------------------------------------------------------------
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
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 14, 2009
02:07 PM
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?)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 15, 2009
09:25 AM
Thanks for reply. I t solved my problem.
Are there any other differences in vbscript while writing a custom action in IS?
Are there any other differences in vbscript while writing a custom action in IS?
![](/skins/images/DB0B6F26716B01F5F6A5A5B88A56CD11/responsive_peak/images/icon_anonymous_message.png)