[solved] InstallValidate Action ignores property changes when product is updated - Advanced Installer Community
a.guelle
Posts: 98
Joined: Tue May 19, 2015 2:23 pm

[solved] InstallValidate Action ignores property changes when product is updated

Hi Everyone,

this one is going to get a bit tricky. Assume you want to deliver files based on user's decision.
So I add a new feature via Organizations and add a condition to it.
Organizations.png
Organizations.png (123.7 KiB) Viewed 4016 times
Next I add a checkbox to a dialog, so that the user can decide if the feature shall be installed or not.
Dialog.png
Dialog.png (171.62 KiB) Viewed 4016 times
So then I build to different product versions (1.0.0 and 2.0.0) with differnt product code.

1. I install version 1.0.0 without checking the feature checkbox.
Result: The product is installed as expected without delivering the feature.
Installation_1.0.0.png
Installation_1.0.0.png (32.22 KiB) Viewed 4016 times
2. I install version 2.0.0 (the uninstallation stage of 1.0.0 runs between dialog stage and installation stage). This time i check the feature checkbox.
Result: The product is installed, but the desired feature file is still missing.

Regarding the log I can see that the property INSTALL_TEST is set to "CheckBox" but the InstallValidate Action shows this:

Code: Select all

TestFeature; Installed: Absent; Request: Null; Action: Null

BUT: If I unsintall version 1.0.0 first and then run the installer for 2.0.0 the feature will be delivered.

Is this the desired behaviour? Why does InstallValidate not recognize the property change from the dialog stage?

You can try yourself with this Demo:
https://kairos.ocloud.de/index.php/s/yiqrCyBZEYKk6W9

Cheers,

Angelo
Last edited by a.guelle on Thu Dec 05, 2019 2:20 pm, edited 1 time in total.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: InstallValidate Action ignores property changes when product is updated

Hello Angelo,

Please allow me to explain why that happens:

1. First of all, a feature state is checked during the CostFinalize standard action

2. When an upgrade is performed, there is a standard action that is executing name MigrateFeatureStates. Basically, this custom action gets the state of the features from the older product and migrates them to the newer product. The bad thing about this is that the MigrateFeatureStates action is executed after the CostFinalize action. Basically, the state of the feature is overwritten during the MigrateFeatureStates, becoming "Absent", therefore not installing.

A workaround for this scenario would be to explicitly set the feature state based on your condition, after the MigrateFeatureState action is executed. The MigrateFeatureState action is executed (if the setup is run with full UI) during the "Wizard Dialogs Stage" --> "Paths Resolution" action group.

The good news about this is the fact that your condition is evaluated during the dialogs, which are spawned during the "User Selection" action group, which takes place after the "Path Resolution" action group.

With that being said, you could proceed as it follows:

- go to "Dialogs" page

- select the dialog that contains the checkbox

- click on the "Next" button

- under "Published Events" tab, add an event as it follows:

Event: Install one or more features localy
Argument: your_feature_identifier
Condition: checkbox is checked (in your case, INSTALL_TEST = "CheckBox")

event.png
event.png (193.32 KiB) Viewed 3992 times


This way, the feature should be correctly installed.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 98
Joined: Tue May 19, 2015 2:23 pm

Re: [solved] InstallValidate Action ignores property changes when product is updated

Hi Catalin,

thank you very much for the explanation and the very detailed workaround description. Your solution worked.

Best regards.

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

Re: [solved] InstallValidate Action ignores property changes when product is updated

You are always welcome, Angelo.

I'm really glad my explanation helped.

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

Return to “Common Problems”