Installer error when using VBScript - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jfuhr
Posts: 41
Joined: Wed Mar 19, 2008 4:52 pm

Installer error when using VBScript

I am getting the following error message when my installer starts up:

"There is a problem with the Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor."

The installer runs fine on my my dev machine, but fails on my Server 2008.

I've narrowed it down to a VBScript that is executed at the beginning to search for a file.

Code: Select all

dim fullPath
dim pathOnly

fullPath = Session.Property("SERVICE_CENTER_PATH")

dim filesys
dim objFile

set filesys = CreateObject("Scripting.FileSystemObject")  'Suspect line
set objFile = filesys.GetFile(fullPath)

pathOnly = filesys.GetParentFolderName(objFile)


Session.Property("APP_INSTALL_PATH") = pathOnly

If I comment out 'set filesys = CreateObject("Scripting.FileSystemObject")', the installer gets past the error message. So it has something to do with Scripting.FileSystemObject.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Installer error when using VBScript

Hi,
So it has something to do with Scripting.FileSystemObject.
This should not affect the script, as you can see in our example this object is used without any problems.

Please reanalyze the script, probably something else is making it to fail. Verify that the variables "fullPath" and "pathOnly" are correctly set. You can use
message boxes to display them.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jfuhr
Posts: 41
Joined: Wed Mar 19, 2008 4:52 pm

Re: Installer error when using VBScript

Bogdan wrote:Hi,
So it has something to do with Scripting.FileSystemObject.
This should not affect the script, as you can see in our example this object is used without any problems.

Please reanalyze the script, probably something else is making it to fail. Verify that the variables "fullPath" and "pathOnly" are correctly set. You can use
message boxes to display them.

Regards,
Bogdan
Correct. The installer will run on some computers, but not all. The script itself is not the problem.

My question is why is the installer is failing on some computers, with that error message. For example, it runs on Windows XP but not Server 2008.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installer error when using VBScript

Hello,

Did you debug the script as Bogdan suggested, using Message Boxes to determine on which line the script fails?

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
jfuhr
Posts: 41
Joined: Wed Mar 19, 2008 4:52 pm

Re: Installer error when using VBScript

Yes, I inserted message boxes to determine where it is failing.

If I remove these lines from the script, the installer runs on my Windows 2008 server.

Code: Select all

dim filesys
dim objFile

set filesys = CreateObject("Scripting.FileSystemObject")  'Suspect line
set objFile = filesys.GetFile(fullPath)
As I wrote in my original post, the installer will run on my Windows XP development PC. It will not run on Windows 2008 server.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installer error when using VBScript

Hello,

You are most likely trying to determine the parent folder of a path which requires administrator privileges, thus FileSystemObject is not able to work with it. This means your custom must run 'with no impersonation' for it to work, but it also means you will not be able to set back the property containing the parent path.
Your script should instead just parse the string and remove the part which comes after the last backslash, to determine the parent path.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”