jm-nov
Posts: 7
Joined: Thu Oct 14, 2021 6:08 pm

Feature-based prereq does not wait for child prereq to install

Thu Oct 14, 2021 8:02 pm

I have three installers built with Advanced Installer 16.7:
  • Installer 1 is a standalone set of software
  • Installer 2 has Installer 1 as a feature-based prereq
  • Installer 3 has Installer 2 as a feature-based prereq
Installer 2 runs fine by itself and successfully installs its prereq (Installer 1).

When I run Installer 3, it starts its prereq (Installer 2), which in turn launches its prereq (Installer 1). In this context, Installer 2 doesn't appear to wait for Installer 1 to finish. The log timestamps show that Installer 2 continues on while Installer 1 runs. Installer 1 eventually finishes successfully, but its parent (Installer 2) fails because it is dependent on Installer 1.

I assume that something is going wrong due to the fact that I have the installers nested like this. Is there any way to force Installer 2 to wait for Installer 1 in the scenario I described? Is there another reason that would cause this to happen?

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

Re: Feature-based prereq does not wait for child prereq to install

Mon Oct 18, 2021 12:07 pm

Hello,

By default, two installation processes can not happen at the same time on the same machine.

More information about this in the following FAQ:

Why do I receive the "Another installation is already in progress" message?

With that in mind,
The log timestamps show that Installer 2 continues on while Installer 1 runs.
the above wouldn't really be possible.

The whole installation process is made up of two smaller processes:

- the client process, where the UI is displayed (the "Wizard Dialogs Stage" in "Custom Actions" page)

- the server process, where the installation script is actually executed (the "Install Execution Stage" in "Custom Actions" page)

If two installers try to run their installation script at the same time, the above error occurs.

To avoid that, our support for feature based prerequisites works like this:

Right when the user presses the "Install" button in the dialogs, before entering the "Install Execution Stage", we launch the prerequisite so the error is avoided.

I have also just tested this and everything seemed to be working as expected - the second installer waited for the first installer to complete.

If possible, could you please create a sample project that reproduces this and forward it to me, either here or by email at support at advancedinstaller dot com?

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

jm-nov
Posts: 7
Joined: Thu Oct 14, 2021 6:08 pm

Re: Feature-based prereq does not wait for child prereq to install

Tue Oct 19, 2021 2:03 pm

Thank you for the additional information.

In creating a sample project, I realized that perhaps the /passive flag for the prereqs contributed to the behavior I'm seeing.

In any event, I've emailed a set of 3 installer files that reproduce the problem.

In the test project, Installer 1 runs a Powershell script that simply sleeps for 10 seconds. Installer 2 has Installer 1 as a passive feature-based prereq. Installer 3 has installer 2 as a passive feature-based prereq.

So Installer 3 runs Installer 2, and Installer 2 runs installer 1.

The observed behavior is as follows:
  • Run Installer 3
  • Installer 3's prereq (Installer 2) is missing, so Installer 2 starts
  • Installer 2's prereq (Installer 1) is missing, so Installer 1 starts
  • Installer 2 finishes
  • Installer 3 finishes
  • Installer 1 finishes (?)

I would have expected Installer 2 to wait until Installer 1 finishes. However, I don't have a lot of experience with installers, so maybe it's the case that nesting installers like this is not supported (or simply a terrible idea).

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

Re: Feature-based prereq does not wait for child prereq to install

Tue Oct 19, 2021 2:13 pm

Hello Justin,

Well, that makes sense now (it's always the little details :) ).

I don't even think the resources are necessary anymore.

Please note that, in case the UI is skipped (such as Basic UI installation and silent installation), the feature based prerequisites are treated as "post-install".

The reason for this is the fact that there isn't any event that can trigger the installation prior to the main setup installation (to avoid double installation).

With that being said, Installer1 will actually be installed after Installer2.

The only solution to this would be to get rid of the "/passive" flag, or perhaps adding the Installer1 as a separate package to Installer3, as a prerequisite.

Hope this helps!

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

Return to “Common Problems”