Regarding status of install failure/cancelled - 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!

slonial
Posts: 13
Joined: Mon Dec 12, 2005 11:41 am

Regarding status of install failure/cancelled

Hi,

How we can identify that installation is failed, are we having any action/condition based on that we can find that install is failed or
canceled.

Thanx,
Sumit
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Test the error code returned by "msiexec" (ERROR_SUCCESS=0, ERROR_INSTALL_USEREXIT=1602 etc). Please see this page for a list of error codes:
http://msdn.microsoft.com/library/defau ... _codes.asp

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
slonial
Posts: 13
Joined: Mon Dec 12, 2005 11:41 am

Hi,

Thanx for the reply, I want to know how we can read the error code returned by msiexec. Another doubt is that installer exe generated by advanced installer project spawns more than one msiexec.


Thanx,
Sumit
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
I want to know how we can read the error code returned by msiexec.
This depends on where do you need this error code. In C++ you would use the "GetExitCodeProcess" API function. In a batch file you would use the %ERRORLEVEL% dynamic environment variable (available for WinNT OSs) or use a conditional command as follows:

Code: Select all

IF ERRORLEVEL 0 GOTO SUCCESS
In a VBScript you would use the value returned by the "Run" method of the "WshShell" object.
Another doubt is that installer exe generated by advanced installer project spawns more than one msiexec.
The EXE bootstrapper generated by AI creates only a single "msiexec" process. However, Windows Installer runs a service when the Execute Sequence is processed and several "msiexec" instances are created due to the way Custom Actions are executed.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
slonial
Posts: 13
Joined: Mon Dec 12, 2005 11:41 am

Hi,

As ours is web product so I tried using vbscript Wshell.Run
but because of IE security issues I am not able to run the installer.
This is the sample code.We are downloading the exe to local files and then trying execute.While doing this I got some IE security errors.

Code: Select all

sSource = "http://localhost:8080/moneycenter%2Finstalls%2Fcsd%2Fhttp%253A%252F%252Flocalhost%253A8080%252Fmoneycenter_70_do%2FMoneyCenter_LoginHelperunicode.exe"
sDest = "C:\installer.exe" 

msgbox "test"
set oHTTP = CreateObject("MSXML2.ServerXMLHTTP") 
set oStream = createobject("adodb.stream") 
oStream.type = 1 

msgbox "test1"
oHTTP.open "GET", sSource, False 
oHTTP.send 

msgbox "test2"
oStream.open 
oStream.write oHTTP.responseBody 
oStream.savetofile sDest,2 

Set oShell = CreateObject("WScript.Shell") 
intRetVal = oShell.Run(sDest,1,True) [/color]

msgbox "error code " & intRetVal

You will be thinking why I have downloaded the file locally
and then call run instead of calling run on webserver file
the reason WShell.Run method won't wait for the process
to complete when u r server path for exe.

Is there anyway to invoke Custom Action on failure of installation
I think that will be easier for me to show user that installation is failed
in browser using vbscript/javascript.

Thanx,
Sumit
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

I am not sure I understand what you are trying to achieve. When an error is encountered, Windows Installer shows the defined "ErrorDialog" (if running in Full UI mode). Then the "FatalError" dialog is shown (this dialog has the sequence equal to -3 in the "InstallUISequence" table).

It is possible to add a Custom Action in the "InstallExecuteSequence" table and then set its sequence number to "-3" using Orca. This CA will be called when an error is encountered.

To read more about the sequence tables, please see:
http://msdn.microsoft.com/library/defau ... _table.asp
http://msdn.microsoft.com/library/defau ... _table.asp

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
slonial
Posts: 13
Joined: Mon Dec 12, 2005 11:41 am

Hi,

I have tried adding CA for failure of Installation, but differntly the way you have mentioned.

1) I have opened the aip (project file) added the CA under InstallExecuteSequence and then open the aip file in Notepad
and then added the Sequence number to -2 for that CA.
2) After that i reopened the aip file the CA was shown under
InstallExecuteSequence\ "nt/2k/xp"

But once I tried running the installer after building package
on failure its calling the CA.For testing in CA I have kept one messageBox.

But log in eventviewer gives unusual error for CA.

Product: MoneyCenterHelper -- 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 LH_installer.vbs_7 script error -2146827264, Microsoft VBScript compilation error: Expected statement Line 11, Column 5, & "Software\Microsoft\Windows\CurrentVersion\Uninstall"

Please comment if you find something wrong mean while I am trying to fix it.

Thanx,
Sumit
slonial
Posts: 13
Joined: Mon Dec 12, 2005 11:41 am

It worked for me thanx for your help.

-Sumit

Return to “Common Problems”