ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Error while installing the MSI file created with Advanced In

Hi,

I have the trial version of AdvancedInstaller9.8. I created a new project "sample.aip". In that I have created 2 "custom actions "CreateExeProcess_dir" and "script.vbs" under Install Execution Stage --> Preparing. (In left side frame).

The "CreateExeProcess_dir" General Properties (in right frame) is as follows

Type: File attached to installation
Source Path: <AI_CUSTACTS>aicustact.dll
Source Type: Dynamic linked library (*.dll)
Function: CreateExeProcess
Action Data: [LIBDIR]>cmd /c del "[TempFolder]libs.txt"

And the source code for "script.vbs" file is

'Holds the path of the directory
Dim directoryListing

directoryListing = Session.Property("CustomActionData")



Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile(directoryListing, ForReading)


Dim classpath

'initialize classpath
classpath = objFile.ReadLine

Do Until objFile.AtEndOfStream
classpath = classpath & ";" & objFile.ReadLine
Loop

Session.Property("LIBPATHS") = classpath
objFile.Close

I have saved this project. When I tried to run this project, it created the .msi file. I tried to install by clicking on it. It is giving me the error. The below is the error log.

Action 13:26:38: script.vbs.
MSI (s) (94:AC) [13:26:38:292]: Executing op: CustomActionSchedule(Action=script.vbs,ActionType=1030,Source='Holds the path of the directory
Dim directoryListing

directoryListing = Session.Property("CustomActionData")



Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(directoryListing, ForReading)

MSGBOX(objFile)
Dim classpath

'initialize classpath
classpath = objFile.ReadLine

Do Until objFile.AtEndOfStream
classpath = classpath & ";" & objFile.ReadLine
Loop

Session.Property("LIBPATHS") = classpath
objFile.Close,Target=YourFunction,)
Error 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.vbs script error -2146828283, Microsoft VBScript runtime error: Invalid procedure call or argument Line 11, Column 1,
MSI (s) (94:C8) [13:26:40:445]: Product: Your Application -- Error 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.vbs script error -2146828283, Microsoft VBScript runtime error: Invalid procedure call or argument Line 11, Column 1,


The above content I have added is per the steps in the URL:

http://www.advancedinstaller.com/forums ... f=2&t=9945




I am in a critical requirement, where the above error is the blocker for me. Please suggest me on this.
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Error while installing the MSI file created with Advance

What i "normally" do when i have vbs errors in AI is

Run the installer with logging, and check what the value of your variable is on the way into your VBS (in your case, you'll want to see what the value being passed in "CustomActionData")

Take a copy of the VBS and run it standalone, substitute in the value that you saw in your log (in your case, you'll want to see what the value being passed in "CustomActionData")
directoryListing = Session.Property("CustomActionData")
to
directoryListing = <whatever the value was from your log>

Add some tracing (msgbox works pretty well) and check your variables are what you think they should be!

and keep running the standalone VBS until you get it to complete without error
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Error while installing the MSI file created with Advance

Hi and welcome to Advanced Installer forum.

Thank you for your interest in Advanced Installer.

It looks like there is a problem with the "script.vbs" you are using. It is not perfectly suitable for your application. You can try to modify it so it matches the settings in your application.

You can also try to debug it the way FergusMurray explained in the post above.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while installing the MSI file created with Advance

@FergusMurray

When I run with the followin code by adding the alert in script.vbs, I am getting the variable dirctoryListing as empty. I am not that much proficient in vbscript. Can you let me know, what could be the problem ?

'Holds the path of the directory
Dim directoryListing

directoryListing = Session.Property("CustomActionData")
MSGBOX(directoryListing)


Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(directoryListing, ForReading)

Dim classpath

'initialize classpath
classpath = objFile.ReadLine

Do Until objFile.AtEndOfStream
classpath = classpath & ";" & objFile.ReadLine
Loop

Session.Property("LIBPATHS") = classpath
objFile.Close
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while installing the MSI file created with Advance

I tried through debugger and found that the .vbs file is working fine. That means, its job is to only get the data from the txt file created and append those entries to the classpath variable seperted by ; .

The "CreateExeProcess_dir" General Properties (in right frame) is as follows

Type: File attached to installation
Source Path: <AI_CUSTACTS>aicustact.dll
Source Type: Dynamic linked library (*.dll)
Function: CreateExeProcess
Action Data: [LIBDIR]>cmd /c del "[TempFolder]libs.txt"


But unfortunately, this file is not getting created with the above configuration. Can you let me know, what could be the problem, the file is not getting created with the classpath entries in it ?
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while installing the MSI file created with Advance

The below issue is resoved and the libs.txt is getting created in the temp folder and all the path entries are getting created. Now the only problem is that, in the sample application test.aip given in the url (as mentioned below) http://www.advancedinstaller.com/forums ... f=2&t=9945, i am able to run the script.vbs file successfully.

But when i create my own project (as discussed below) and try to run, the libs.txt file is created, but in the scripts.vbs, the line Set objFSO = CreateObject("Scripting.FileSystemObject") is not able to run. As mentioned below the error is

Error 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.vbs script error -2146828283, Microsoft VBScript runtime error: Invalid procedure call or argument Line 11, Column 1,
MSI (s) (94:C8) [13:26:40:445]: Product: Your Application -- Error 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.vbs script error -2146828283, Microsoft VBScript runtime error: Invalid procedure call or argument Line 11, Column 1,

Any idea what will be the configuration, I may have missed in creating my own project shmilar to test.aip. Why the above mentioned line (Set objFSO = CreateObject("Scripting.FileSystemObject") ), is running in the test.aip and not in the new project which i have created.

Please suggest me on this.
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Error while installing the MSI file created with Advance

entirely a guess, but you havent "dim" the FSO

This is ripped from some of my scripts and it works okay for me, its also using the FileSystemObject, and it looks similar to the way you are doing it

Code: Select all

	Dim fso, msg, objFSO, objFolder,colFiles,counted,temp, Installdir
	Installdir=Session.Property("APPDIR")&"Settings\Screens"
	Set fso = CreateObject("Scripting.FileSystemObject")
	counted=0
	If (fso.FolderExists(Installdir)) Then
		Set objFSO = CreateObject("Scripting.FileSystemObject")
		Set objFolder = objFSO.GetFolder(Installdir)
...
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while installing the MSI file created with Advance

Making it Dim didn't solve the issue either.... :-(

Return to “Common Problems”