VBScript 1720 Error?
I tested the VBScript outside of the MSI and it worked perfectly fine. When I try to execute the Custom Action of calling it from the installation it fails and throws me the 1720 Error. The code is as follows:
The script seems to fail around the "Set fso" line. I get the two input dialog boxes before it fails. Any idea of why this is happening?
DIM fso, NewsFile
Const RDP = "test.rdp"
username = InputBox("Please enter the your Echo Account Username:","Echo Account Username")
systemname = InputBox("Please enter your computer name:","Computer Name")
Set fso = CreateObject("Scripting.FileSystemObject")
Set NewsFile = fso.OpenTextFile(RDP, 8)
NewsFile.WriteLine("username:s:"& username)
NewsFile.WriteLine("domain:s:domain")
NewsFile.WriteLine("full address:s:"& systemname &".domain.com")
NewsFile.Close
The script seems to fail around the "Set fso" line. I get the two input dialog boxes before it fails. Any idea of why this is happening?
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
MSIPackager
18 years ago
Posted by:
rpfenninger
18 years ago
Posted by:
cessna
18 years ago
ORIGINAL: MSIPackager
Use message boxes (msgbox) to find out exactly where the script is failing..
You haven't defined a path to the test.rdp file you are opening either.. are you sure your script can find it?
Also, where have you sequenced the CA - execute immediate / deferred etc?
Cheers,
Rob.
Thanks! I had to give it the fully qualified path to the file. The MSI installs the vbscript on the hdd next to the "test.rdp" file. I had assumed incorrectly that it would find the file. When I tested the vbscript outside of the MSI it had worked perfectly fine.
Posted by:
MSIPackager
18 years ago
No probs, glad to have helped...
rpfenninger makes a good point too - definately worth bearing in mind when using embedded VBScript as a CA:
Never:
Set wshell = WScript.CreateObject("WScript.Shell")
Always:
Set wshell = CreateObject("WScript.Shell")
Explanation of why is here (2nd note at the bottom)
That one catches everyone out sooner or later [:@]
Regards,
Rob.
rpfenninger makes a good point too - definately worth bearing in mind when using embedded VBScript as a CA:
Never:
Set wshell = WScript.CreateObject("WScript.Shell")
Always:
Set wshell = CreateObject("WScript.Shell")
Explanation of why is here (2nd note at the bottom)
That one catches everyone out sooner or later [:@]
Regards,
Rob.
Posted by:
cessna
18 years ago
Posted by:
noodles187
18 years ago
that one
Hello my learned packagers, i added a vb script to my CA for a package and i get error 1720 while trying to run as "user", but it installs fine as admin.
Below is my script
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.opentextfile("c:\windows\system32\drivers\etc\services.", 8)
file.writeline "K293live 2501/tcp #Figtree live DB"
file.close
Can anyone please detect if anything is the problem here
Thanks
Posted by:
brenthunter2005
18 years ago
Thats because "users" don't have the neccessary NTFS permissions to edit this file.
You need to run the custom action in the "Deferred Execution - System Context" and place the action before the InstallFinalize actions. Remember to condition the custom action so that it only runs on installation etc.
You need to run the custom action in the "Deferred Execution - System Context" and place the action before the InstallFinalize actions. Remember to condition the custom action so that it only runs on installation etc.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.