jminsa
Posts: 25
Joined: Mon Oct 29, 2018 5:45 pm

Use a extended search in Launch Conditions does not work due to be executed too late

Hi,

I have two builds, one build includes pre-requisites, the other not.
In the build that does not include the pre-requisites I have added a custom condition based on a property, the value of this property is filled in an extended search which looks for a registry entry. This is to tell the user that because the pre-requisites are not installed needs to use the full package.

The problem I have is that the extended search is executed in the AI_AppSearchEx action instead of being done in the AppSearch action.
I have confirmed in the log that the AppSearch is executed before the launch conditions are evaluated but the AI_AppSearchEx is executed afterwards (too late)

Is there any way of forcing the AI_AppSearchEx to be executed before the launch conditions are evaluated or a way of moving the extended search to the AppSearch action.

I do not understand why the searches I have in ini files are executed in the AppSearch action and the extended searches are executed in the AI_AppSearchEx action.

thanks in advance
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hello,

By default, the "AI_AppSearchEx" custom action should be scheduled before the "LaunchConditions" standard action. The default sequence value for each action is as follows:

- 100 for "AppSearch"

- 101 for "AI_AppSearchEx"

- 400 for "LaunchConditions"

You may encounter that issue if you have manually edited these values in the "Table Editor" --> "InstallExecuteSequence" table and "InstallUiSequence" table. If this is not the case, could you please send me the .AIP and the verbose log by e-mail at support at advancedinstaller dot com so I can further investigate this?

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jminsa
Posts: 25
Joined: Mon Oct 29, 2018 5:45 pm

Re: Use a extended search in Launch Conditions does not work due to be executed too late

I have sent in an email to support the files requested.
The email subject is "Re: Use a extended search in Launch Conditions does not work due to be executed too late"

Best regards
Jose
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hello Jose,

First of all, thank you for the sent files.

After having a look over your project, it seems that the actions are correctly scheduled, meaning that the searches are executed before the launch conditions are evaluated.

After having a look over the log file, it seems that the launch condition that has as condition the following search - "PREREQ_CPLUPLUS_INSTALLED" is failing. Can you please make sure that the "Version" registry key exists and has a value higher than the one specified in the "Minimum" field of your search in the following location:

HKLM\SOFTWARE\WOW6432Node\Microsoft\DevDiv\VC\Servicing\12.0\RuntimeMinimum\Version

If the registry entry exists and has a value higher than the one specified in the "Minimum" field of your search and the setup is still failing, please send me a download link of the setup by e-mail at support at advancedinstaller dot com so I can further investigate this.

Hope this helps.

Kind regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jminsa
Posts: 25
Joined: Mon Oct 29, 2018 5:45 pm

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hi,

The registry entry exist, I had checked all that before (see the image attached), in fact it is the same condition to check if the pre-requisite is installed in the full package build and in that works perfectly.
registry1.png
registry1.png (30.3 KiB) Viewed 8150 times
What I dont understand is where have you seen in the log I sent you that the "PREREQ_CPLUSPLUS_INSTALLED" is being performed, because I cannot find it in the log.

This is the relevant section of the log:

Action start 13:46:24: AppSearch.
AppSearch: Property: CMM_SERVER_IP, Signature: AppSearchSign_2
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 2262 2: Signature 3: -2147287038
AppSearch: Property: SIP_SERVER_IP, Signature: AppSearchSign
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 2262 2: Signature 3: -2147287038
AppSearch: Property: SIP_SERVER_PORT, Signature: AppSearchSign_1
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 2262 2: Signature 3: -2147287038
AppSearch: Property: AI_SETUPEXEPATH, Signature: AI_EXE_PATH_LM
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE32\Software\Caphyon\Advanced Installer\LZMA\{956C27D3-8ACE-4065-8631-26592ADD0B8E}\0.0.58 3: 2
AppSearch: Property: AI_SETUPEXEPATH, Signature: AI_EXE_PATH_CU
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (c) (2C:C8) [13:46:24:157]: Note: 1: 1402 2: HKEY_CURRENT_USER32\Software\Caphyon\Advanced Installer\LZMA\{956C27D3-8ACE-4065-8631-26592ADD0B8E}\0.0.58 3: 2
Action ended 13:46:24: AppSearch. Return value 1.
MSI (c) (2C:C8) [13:46:24:157]: Doing action: PreparePrereqDlg
Action 13:46:24: PreparePrereqDlg.
Action start 13:46:24: PreparePrereqDlg.
Action ended 13:46:24: PreparePrereqDlg. Return value 1.
MSI (c) (2C:C8) [13:46:24:219]: Doing action: LaunchConditions
Action 13:46:24: LaunchConditions. Evaluating launch conditions
Action start 13:46:24: LaunchConditions.
Visual C++ Redistributable pre-requisite is missing.
Instead of using this upgrade only package, you need to use the "CeCoCo Operator Setup" full package.

Clearly the AppSearch action is performed, but the AI_AppSearchEx action is not performed, and the "PREREQ_CPLUSPLUS_INSTALLED" is performed in the AI_AppSearchEx action.
AppSearch.png
AppSearch.png (19.83 KiB) Viewed 8150 times
AI_AppSearchEx.png
AI_AppSearchEx.png (25.21 KiB) Viewed 8150 times
It seems to me that the search is not being performed before evaluating the launch conditions.

What I don't know is why the XML searches go to the AppSearch action and the registry searches go to the AI_AppSearchEx action.

Please take a look at this.

Best regards
Jose
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hello Jose,

Can you please try the following:

- Go to "Prerequisites" page --> select "Packages" and uncheck the "Check launch conditions before searching for prerequisites" option from under the "Global Prerequisite Options".
What I don't know is why the XML searches go to the AppSearch action and the registry searches go to the AI_AppSearchEx action.
This is happening because the XML Searches are regular searches, while the Registry Searches are "extended" searches. For more information about this, please have a look over our "Extended Search Properties" article.

Please let me know if this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jminsa
Posts: 25
Joined: Mon Oct 29, 2018 5:45 pm

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hi Catalin,

That worked beautifully!

Thank you very much
Jose
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hello Jose,

You are always welcome. I am really glad you overcame this issue.

After further investigating this, I have also found another workaround for this (which I think is better than the last one). Here is how it works:

- Since you have an EXE package, the launch conditions are verified during the "BootstrapperUISequeunce". If you go to the respective table in the "Table Editor" page, you will see that only the "AppSearch" action is executed before the "LaunchConditions" action --> this being the reason why your extended searches were not executed -> because the extended searches are part of the "AI_AppSearchEx" action, which by default does not get executed during the "BootstrapperUISequence".

This is why your launch condition was failing, because the search was actually not executed (as you have already stated in your earlier thread/s)

- The workaround would be to add the "AI_AppSearchEx" action in the "BootstrapperUISequence" table ("Table Editor") and schedule it before the "LaunchCondition" action (should have a lower "Sequence" number associated).

Please let me know if this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jminsa
Posts: 25
Joined: Mon Oct 29, 2018 5:45 pm

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hello,

Today I had time to check the second solution and it also works, I am going to follow your advice, but I am wondering why do you think that the latter is a better solution. I supose it has to do with not affecting other possible functionalities or cases.

Thank you very much
Jose
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Use a extended search in Launch Conditions does not work due to be executed too late

Hello Jose,

I am glad the second solution worked for you. Well, I think it is better because if you uncheck that option, you may encounter some other unwanted behavior. For example, your prerequisites can install and then, when the launch conditions are checked (because if that option is unchecked, the launch condition(s) will be evaluated after the prerequisite(s) install), your main setup can fail (if the launch condition is evaluated as false). This is, for sure, not a desired behavior.

Hope you now know why the second approach is better than the first one.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”