HobartSimms
Posts: 14
Joined: Wed Feb 26, 2020 7:03 pm

Prerequisite Install Conditions Order of Operations

Hi - I have a prerequisite that depends on all conditions being false.
If one of the conditions returns true, will A.I. stop processing the other condition rules below, or are they always evaluated regardless?
For example:
---------------------------------------------------------
1. If registry key exists
2. Search by custom exe

Selected - install pre-req if all conditions are false.
----------------------------------------------------------

If rule 1 returns true, is rule 2 evaluated anyway?

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

Re: Prerequisite Install Conditions Order of Operations

Hello and welcome to Advanced Installer forums,

To be fully honest with you, I can not say for sure whether the evaluation stops after a condition is evaluated as true or if it continues.

I am not quite sure why you would need to know that. Could you please give me some more details about your scenario so I can better understand this?

Normally, in what regards the prerequisites, only the final result matters, which is whether the prerequisite will be installed or not.

I would say that the only case where this matters is maybe a performance type scenario where obviously, it would be more efficient to not check the other conditions if one is evaluated as true.

Hope this helps somehow.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HobartSimms
Posts: 14
Joined: Wed Feb 26, 2020 7:03 pm

Re: Prerequisite Install Conditions Order of Operations

If would be very beneficial, in my case, if rule #2 never ran based on rule #1 returning true.
For example, the rule #2 .EXE has already been run externally by another application or user - and I do not want it to run again. In fact, this is what rule #1 is actually checking for.

This all stems from not being able to inject a script prior to the prerequisites check.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Prerequisite Install Conditions Order of Operations

Hello,

Thank you for your explanation.

To be fully honest with you, I believe that this should indeed be the normal behavior, as it would be more efficient than checking the rest of the conditions, if one is already true. However, as mentioned in my previous thread, I can not say for sure this is the case as I was not the one that developed the logic for this.
This all stems from not being able to inject a script prior to the prerequisites check.
As you may already know, a prerequisite's condition(s) is checked two times:

- before the prerequisite is installed --> the conditions must be false => the prerequisite will be installed

- after the prerequisite is installed --> the conditions must be true => the prerequisite was installed correctly

Basically, if you insert the script before the prerequisite is installed means that you insert it before the conditions are checked.

For instance, if you prerequisite is of "pre-install" type, you can insert your script on the dialog prior to the one installing the prerequisite.
scriptPriorToPrereq.png
scriptPriorToPrereq.png (184.3 KiB) Viewed 2549 times

The script should be added as a custom action without sequence, so you can trigger it from a dialog control.

The same logic can be applied to "feature-based" prerequisites as well.

However, there is indeed a drawback to this and that is if you plan to deliver your setup for silent installations. Since the UI will not be spawned, the custom action will not be executed.

Hope this helps.

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

Return to “Building Installers”