vdrake
Posts: 12
Joined: Tue Aug 17, 2021 3:25 am

Use a search parameter in dialog logic

Mon Aug 23, 2021 4:46 pm

I would like to customize the dialogs based on the version being *upgraded from*.
I've used a Search to find the version number associated with OLDPRODUCTS and stored that in SUPPORTS_EXISTING_SERVICE_NO_CHANGE when version number of OLDPRODUCTS is greater than 12.2.0.
I can see this property being populated correctly in the installer logs, but its value isn't available at the time my welcome dialog needs it.

How can I get my welcome dialog to run *after* the standard Searches step? For some reason, CustomActions shows my WelcomeDlg appearing right *before* Searches and I can find no way of moving it lower down in the sequence.

Thanks!
Vince

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

Re: Use a search parameter in dialog logic

Mon Aug 23, 2021 5:10 pm

Hello Vince,

This is quite strange.

By default, a search should be executed long before the "WelcomeDlg" dialog is spawned.
welcomedlg.png
welcomedlg.png (34.7KiB)Viewed 5350 times

Did you, by any chance, modify the sequence number of these actions in the "Table Editor"?
welcomedlgtableeditor.png
welcomedlgtableeditor.png (90.21KiB)Viewed 5350 times

Both of the above screenshots are from a newly created project.

With that, displaying the version number of the previously installed works just fine.
versionOLDPRODUCTS.png
versionOLDPRODUCTS.png (29.49KiB)Viewed 5350 times

and at install time:
installtime.png
installtime.png (122.56KiB)Viewed 5350 times



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

vdrake
Posts: 12
Joined: Tue Aug 17, 2021 3:25 am

Re: Use a search parameter in dialog logic

Mon Aug 23, 2021 6:07 pm

Thanks Catalin!

Things were, indeed, out of order.
My CerberusWelcomeDlg is sequence number 82
AppSearch is sequence number 100

That is odd.
Perhaps it was because I right-clicked the PrepareDlg and Add Dialog To Squence to create my welcome dialog.
It could also be because this install script is 12 years old and nowhere near the "default project" any more :D

So I've used the Table Editor to move my welcome dialog just before the install dialog:
WelcomeSequenceTableEditor.png
WelcomeSequenceTableEditor.png (124.37KiB)Viewed 5347 times
I'm using this Search action:
SearchVersionByProductCode.png
SearchVersionByProductCode.png (31.77KiB)Viewed 5347 times
Nevertheless, when upgrading from 12.2.0 to 12.2.1, the SUPPORTS_EXISTING_SERVICE_NO_CHANGE property isn't available by the time my dialog runs.

Unsure if it is relevant, but the Custom Actions screen still shows CerberusWelcomDlg happening in the wrong spot:
WelcomeSequence.png
WelcomeSequence.png (71.05KiB)Viewed 5347 times
I've looked through the installer log and see another thing that might explain it:

Code: Select all

MSI (c) (A0:64) [12:50:05:303]: Doing action: AI_AppSearchEx
Action start 12:50:05: AI_AppSearchEx.
MSI (c) (A0:3C) [12:50:05:373]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\MSI9DCC.tmp, Entrypoint: DoAppSearchEx
MSI (c) (A0!08) [12:50:05:492]: PROPERTY CHANGE: Adding PreReqSearch_D36C9FE0826D4D2B9C2DDCAiVerMin property. Its value is '14.21.27702'.
MSI (c) (A0!08) [12:50:05:492]: PROPERTY CHANGE: Adding PreReqSearch_D36C9FE0826D4D2B9C2DDC property. Its value is '14.29.30037'.
MSI (c) (A0!08) [12:50:05:493]: PROPERTY CHANGE: Adding SUPPORTS_EXISTING_SERVICE_NO_CHANGEAiVerMin property. Its value is '12.2.0'.
MSI (c) (A0!08) [12:50:05:497]: PROPERTY CHANGE: Adding AI_PrereqsFulfilled property. Its value is '1'.
Action ended 12:50:05: AI_AppSearchEx. Return value 1.
MSI (c) (A0:64) [12:50:05:499]: Doing action: AI_DetectSoftware
Action start 12:50:05: AI_DetectSoftware.
MSI (c) (A0:80) [12:50:05:505]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\MSI9E98.tmp, Entrypoint: OnDetectSoftware
Action ended 12:50:06: AI_DetectSoftware. Return value 1.
MSI (c) (A0:64) [12:50:06:331]: Doing action: AI_RESTORE_AI_SETUPEXEPATH
Action start 12:50:06: AI_RESTORE_AI_SETUPEXEPATH.
Action ended 12:50:06: AI_RESTORE_AI_SETUPEXEPATH. Return value 1.
MSI (c) (A0:64) [12:50:06:332]: Doing action: FindRelatedProducts
Action start 12:50:06: FindRelatedProducts.
MSI (c) (A0:64) [12:50:06:333]: PROPERTY CHANGE: Adding OLDPRODUCTS property. Its value is '{DFC29FB0-D37E-411C-A8EC-03948B13A008}'.
MSI (c) (A0:64) [12:50:06:333]: PROPERTY CHANGE: Adding MIGRATE property. Its value is '{DFC29FB0-D37E-411C-A8EC-03948B13A008}'.
Action ended 12:50:06: FindRelatedProducts. Return value 1.
The search method I'm using requires OLDPRODUCTS to be set, but that gets set after AI_AppSearchEx is run.

Judging from later in the log, AI_AppSearchEx is responsible for setting my property. I see it running successfully much later in the log (long after my dialog has displayed and been dismissed):

Code: Select all

MSI (s) (68:10) [12:51:04:980]: Doing action: AI_AppSearchEx
Action start 12:51:04: AI_AppSearchEx.
MSI (s) (68:14) [12:51:04:986]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI86E9.tmp, Entrypoint: DoAppSearchEx
MSI (s) (68!0C) [12:51:05:030]: PROPERTY CHANGE: Adding PreReqSearch_D36C9FE0826D4D2B9C2DDCAiVerMin property. Its value is '14.21.27702'.
MSI (s) (68!0C) [12:51:05:030]: PROPERTY CHANGE: Adding PreReqSearch_D36C9FE0826D4D2B9C2DDC property. Its value is '14.29.30037'.
MSI (s) (68!0C) [12:51:05:032]: PROPERTY CHANGE: Adding SUPPORTS_EXISTING_SERVICE_NO_CHANGEAiVerMin property. Its value is '12.2.0'.
MSI (s) (68!0C) [12:51:05:032]: PROPERTY CHANGE: Adding SUPPORTS_EXISTING_SERVICE_NO_CHANGE property. Its value is '12.2.0'.
MSI (s) (68!0C) [12:51:05:038]: PROPERTY CHANGE: Adding AI_PrereqsFulfilled property. Its value is '1'.
Action ended 12:51:05: AI_AppSearchEx. Return value 1.
Can you see a way of resolving this? I really like this way of setting a property based on whether it falls between min and max versions. Is there an alternative? Can I continue changing sequence so that FindRelatedProducts happens before AI_AppSearchEx?

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

Re: Use a search parameter in dialog logic

Thu Aug 26, 2021 6:39 pm

Hello Vince,
That is odd.
Perhaps it was because I right-clicked the PrepareDlg and Add Dialog To Squence to create my welcome dialog.
This is most likely the reason here. :)

Your deduction regarding the execution order is indeed correct.

The search you are using is an extended search and therefore it is executed during the "AI_AppSearchEx" action, while the OLDPRODUCTS property is set during the "FindRelatedProducts" standard action.

Since your search relies on the OLDPRODUCTS property, the logical execution order should be "FindRelatedProducts" and then "AI_AppSearchEx", therefore the answer to this:
Can I continue changing sequence so that FindRelatedProducts happens before AI_AppSearchEx?
is yes.

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

Return to “Common Problems”