/bundles/itninjaweb/img/Breadcrumb_cap_w.png
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:


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   [ - ] Hide Comments

Comments

Please log in to comment

Community Chosen Answer


Answers

2
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.
Answered 02/05/2006 by: MSIPackager
Third Degree Black Belt

Please log in to comment
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
I'm not very keen at creating complicated scripts.
The only thing I know is that it's important to include the following when you try to execute a VB Script from inside a MSI:


CreateObject("Wscript.Shell")


I don't know if this is the problem in your case.

Hope it helps

Roland
Answered 02/06/2006 by: rpfenninger
Second Degree Green Belt

Please log in to comment
0
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.
Answered 02/06/2006 by: cessna
Senior Yellow Belt

Please log in to comment
0
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.
Answered 02/06/2006 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
Hehe, yup. I originally had that problem and tracked that one down. [:@]
Answered 02/06/2006 by: cessna
Senior Yellow Belt

Please log in to comment
0
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
Answered 09/20/2006 by: noodles187
Orange Belt

Please log in to comment
0
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.
Answered 09/20/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment