/build/static/layout/Breadcrumb_cap_w.png

VBscript error during install

I have a vbscript that runs during install to overwrite an existing file based on a condition. It works fine if I don't have any spaces in the path such as C:\windows\newfile.txt but if I want to use C:\Documents and Settings\All Users\Application Data\OrderPad it will fail with a path error. Using 8.3 short names seems like a kludge fix and while it does actually work I still get the following errors in the windows installer log. Using CA type 70.

Log file

Doing action: ConnPF
Action ended 11:54:06: InstallExecute. Return value 1.
MSI (s) (D0:64) [11:54:06:078]: Transforming table CustomAction.

MSI (s) (D0:64) [11:54:06:078]: Transforming table Binary.

MSI (s) (D0:8C) [11:54:06:090]: Note: 1: 1720
Action start 11:54:06: ConnPF.
Info 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action script error , : Line , Column ,



VBscript

'Create a text file

DIM fso, ConnFile

Set fso = CreateObject("Scripting.FileSystemObject")
Set ConnFile = fso.CreateTextFile("C:\Documents and Settings\All Users\Application Data\OrderPad\OrderPad.exe.conn", True)
ConnFile.WriteLine "<?xml version=""1.0"" encoding=""utf-8""?>"
ConnFile.Write "<connection name=""LOCAL"" prompt=""False"" dataModified=""False"" />"
ConnFile.Close

0 Comments   [ + ] Show comments

Answers (6)

Posted by: joedown 13 years ago
Third Degree Brown Belt
0
Changed the script from a file in the binary table to the custom action table and set the type to 3110. Now it works without any errors although I would like to know what the correct formatting should be in the script to allow long names.
Posted by: captain_planet 13 years ago
Black Belt
0
You should be able to do this:
Dim fso, ConnFile, folder

Set fso = CreateObject("Scripting.FileSystemObject")

Set folder = fso.GetFolder("C:\Documents and Settings\All Users\Application Data\OrderPad\")

Set ConnFile = folder.CreateTextFile("OrderPad.exe.conn")

ConnFile.WriteLine "<?xml version=""1.0"" encoding=""utf-8""?>"
ConnFile.Write "<connection name=""LOCAL"" prompt=""False"" dataModified=""False"" />"
ConnFile.Close

Set fso = Nothing
Set folder = Nothing
Set Connfile = Nothing


but in any case, you need to check the 'OrderPad' folder exists first, and rather than hard coding the path use environment variables etc.....
Posted by: joedown 13 years ago
Third Degree Brown Belt
0
Thanks! That worked great although I don't really understand why getting the folder works?
Posted by: anonymous_9363 13 years ago
Red Belt
0
Nice one, Cap'n. I've learned something today :-)

Joe, FFR, there is a dedicated 'Scripting' forum on AppDeploy.
Posted by: captain_planet 13 years ago
Black Belt
0
ORIGINAL: joedown

I don't really understand why getting the folder works?
- errrm (cough)....neither do I.....[&:]

ORIGINAL: VBScab

I've learned something today :-)
- Ha. I'm not sure whether to interpret that as sarcasm, but if not, you're welcome. [;)]
Posted by: anonymous_9363 13 years ago
Red Belt
0
For a change, the [sarcasm] tag remains unused. I genuinely didn't know that that was a valid construct.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ