vcorazza
Posts: 17
Joined: Wed Dec 06, 2017 3:14 pm

Installer return code when prerequisite fails

Fri Jan 26, 2018 1:06 pm

For various reasons we need to launch the installer from command line. The fact is that if a feature prerequisite fails (upgrade to sqlserver 2014 in this case), it seems that the exit code of the main installer is 0. Is there something I have to do in order to have an error return code?
Thanks

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer return code when prerequisite fails

Tue Jan 30, 2018 4:06 pm

Hi,

Normally, when a prerequisite fails, a warning message is displayed asking the user if he wants to continue with the installation of the main package or not. If he decides to continue with the installation, the main package will be installed successfully and a success code will be returned, otherwise the main installation will stop.

In order to block the installation of the main installer if a prerequisite fails, you can go in the "Properties" tab of that prerequisite and uncheck the "Continue with main installation even if the prerequisite is not installed" option.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

vcorazza
Posts: 17
Joined: Wed Dec 06, 2017 3:14 pm

Re: Installer return code when prerequisite fails

Wed Jan 31, 2018 9:37 am

Thank you for your reply.
But it seems that when the prerequisite fails (it is a feature prerequisite), the main installation stops (the check you mention is already unchecked: this is what I need), but the return code is still 'success'.
Is this a bug, a normal behavior or am I missing something?

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer return code when prerequisite fails

Wed Jan 31, 2018 1:10 pm

Hi,

During my tests an error code was returned in case a prerequisite failed. Can you please tell me how you get this code (maybe send me a screenshot with it)?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

vcorazza
Posts: 17
Joined: Wed Dec 06, 2017 3:14 pm

Re: Installer return code when prerequisite fails

Wed Jan 31, 2018 2:23 pm

I think that it is better if I describe you the issue.

Our application installer is created with exe and resources next to it.
It has Microsoft SQL Server 2014 as a featured resource.
The test: install on Windows Server 2008 with SqlServer 2005 SP3.

Since SqlServer 2014 upgrade requires SqlServer 2005 SP4, the sql server upgrade fails (it is launched with minimum user interface)
On the dos prompt %errorlevel% is 0
advsql.png
advsql.png (17.75KiB)Viewed 7733 times

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer return code when prerequisite fails

Thu Feb 01, 2018 2:25 pm

Hi,

Is the main installer also installed with minimum user interface or only the prerequisites?

When the main package is installed with Full UI, it waits until the prerequisites are installed. However, when it is installed with Basic UI or in silent mode, it does not wait for the prerequisites to be installed, instead an executable is launched which will manage the installation of the prerequisites.

This is necessary because of the way Windows Installer is designed. Two packages cannot run at the same time, so we need to launch a small EXE at the end of the main package and that EXE will manage the installation of the prerequisites. However, the main installer exits after that EXE is launched, so the command prompt receives the main installer's return code before the prerequisites to be installed.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

vcorazza
Posts: 17
Joined: Wed Dec 06, 2017 3:14 pm

Re: Installer return code when prerequisite fails

Thu Feb 15, 2018 6:01 pm

I'm pretty sure in the tests I was running the main installer with the full UI, but in most cases it will be run silently.
Does this mean that I cannot verify this scenario? Or that my main program will continue before Sql finises installation? This could be an issue...

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer return code when prerequisite fails

Mon Feb 19, 2018 1:43 pm

Hi,

Normally, each prerequisite returns a value when its installation is completed and the installation of another prerequisite (if it exists) or the main installer is started. The main installer may return a success code if it receives a success code from the prerequisite before the installation of that prerequisite to be completed (for example, the prerequisite launches another process and it exits).

Also, this may happen if the main installer is run with Basic UI or in silent mode. Unfortunately, this is a Windows Installer limitation. So an option for you would be to receive the return value of the prerequisite's process too, not only the return value of the main installer.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Kashif Iqbal
Posts: 7
Joined: Fri Jan 17, 2020 5:30 pm

Re: Installer return code when prerequisite fails

Wed Sep 23, 2020 5:28 pm

Hi Dear Team,

Please Help to sort out the problem I am working on this from last week but not found any solution except system re start.

Issue is this when we Install the Microsoft .NET Framework 1.1 as a pre requisite with installer setup first time its run successfully.
Then I will uninstall the Microsoft Framework and installer exe and start again installation.
This time on pre requisite show this error

"an error occurred while windows installer was initializing. setup will now close"

Please help I'm waiting for your response.
Thanks
Attachments
3.PNG
3.PNG (31.42KiB)Viewed 5725 times

vcorazza
Posts: 17
Joined: Wed Dec 06, 2017 3:14 pm

Re: Installer return code when prerequisite fails

Thu Sep 24, 2020 7:13 am

I think that you are not able to completely uninstall .Net framework without a reboot. Have you tried to look at the logs of the .Net installer?

Kashif Iqbal
Posts: 7
Joined: Fri Jan 17, 2020 5:30 pm

Re: Installer return code when prerequisite fails

Thu Sep 24, 2020 7:52 am

Dear Team,

If I install Microsoft .NET Framework 1.1 Separately
Then it work fine install / uninstall and again installation done successfully.

In case of Advance installer First time install successfully when I will uninstall and start again installation then showing this error.

We are using Advanced installer with profession License.
Can you help me to sort out this error.

Thanks & Regards
Kashif Iqbal

vcorazza
Posts: 17
Joined: Wed Dec 06, 2017 3:14 pm

Re: Installer return code when prerequisite fails

Thu Sep 24, 2020 9:46 am

The only reason I can think about is that the application is still running at the moment the framework is being uninstalled

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Installer return code when prerequisite fails

Mon Sep 28, 2020 4:46 pm

Hello Kashif, Ricardo,

@Ricardo, thank you very much for the provided information and for trying to help Kashif.

@Kashif,

First of all, please note that the encountered error is thrown to the .NET Installer itself, not by your setup.

After doing a little bit of research, it looks like Ricardo may be right.

After installing & uninstalling, could you pelase do a system restart, then try to install the setup once again and let me know if this issue still persists?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”