Peter Bi
06-27-2002, 11:43 AM
Hi,
When I executed a simple CA of vbscript (the code is 'Stored directly in the custom action'), I got error 1720. Here is the code:
--------------------------------------------
Dim WshShell, bKey
set WshShell = WScript.CreateObject("WScript.Shell")
bKey = WshShell.RegRead("HKLM\Software\Myproduct\InstallDir")
if Len(bKey)>1 then
Property("INSTALLDIR") = bKey
end if
-----------------------------------------------
It seems once I have WScript.CreateObject, it will produce the error. Does that mean that there is only restricted vbscript can be used for CA in Basic project? How can I create WScript objects (Shell, Network, etc.) in vbscript code?
Thanks,
Peter
When I executed a simple CA of vbscript (the code is 'Stored directly in the custom action'), I got error 1720. Here is the code:
--------------------------------------------
Dim WshShell, bKey
set WshShell = WScript.CreateObject("WScript.Shell")
bKey = WshShell.RegRead("HKLM\Software\Myproduct\InstallDir")
if Len(bKey)>1 then
Property("INSTALLDIR") = bKey
end if
-----------------------------------------------
It seems once I have WScript.CreateObject, it will produce the error. Does that mean that there is only restricted vbscript can be used for CA in Basic project? How can I create WScript objects (Shell, Network, etc.) in vbscript code?
Thanks,
Peter