Vedanta
Posts: 15
Joined: Tue Oct 29, 2013 9:16 pm

Show Dialog based on Prerequisite Install Condition

Hello,

So I have a prerequisite that is set in

"Install prerequisite based on condition" on

It checks if a register key exists and installs based on that.

Now I have an dialog for this prerequisite with some terms and stuff and would like to not show it if the previous Registry key install conditions were not met and the prerequisite should not be installed. How can I do this?

Thanks!
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Show Dialog based on Prerequisite Install Condition

Hello,
It checks if a register key exists and installs based on that.
The result of this search will be stored in a property. This property can be seen in the AI_AppSearchEx table from the Table Editor page.

In order to show a dialog based on a condition you can use the Show only if... option. Select you dialog which you want to show based on the condition and from the context menu select the "Show only if..." option and add in the Condition field the property which has been assigned to the search operation in order to fit your scenario.

Please let us know if you have other questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Vedanta
Posts: 15
Joined: Tue Oct 29, 2013 9:16 pm

Re: Show Dialog based on Prerequisite Install Condition

Oh ok cool. I see it there.

But I still have one issue. I will have like 400 registry keys that will be checked. Does this mean I need to setup a "Show Only If" condition on every single one??

Also what kind of condition do i set on the AI_AppSearchEx if my Property name is PreReqSearch for instance and it's searching for the existence of a registry key.

Do I just set a condition of PreReqSearch = 1 ? or something
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Show Dialog based on Prerequisite Install Condition

Hello,

Please note that the property assigned to the search operation will be set if the search operation will be successfully, otherwise it will be empty.
But I still have one issue. I will have like 400 registry keys that will be checked. Does this mean I need to setup a "Show Only If" condition on every single one??
I'm not sure I fully understand your scenario. Would you like to say that you had created or you will create 400 registry key searches? How many prerequisite do you have in your installation package that you need to search for about 400 registry keys?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Vedanta
Posts: 15
Joined: Tue Oct 29, 2013 9:16 pm

Re: Show Dialog based on Prerequisite Install Condition

I have one prerequisite but it needs to search for 400 different registry keys. So it will create 400 registry key searches.

These is a large list of conflicting programs etc. I don't want the prereq installed if any of those keys exist.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Show Dialog based on Prerequisite Install Condition

Hello,

Since you only have one prerequisite and you need to search for so much registries (400), you should have another approach for this, not to create 400 searches. Also, you want to show a dialog based on the searches result, so you should have all these search properties in the Show only if... condition for the related dialog.

For example, you can create your own custom executable (.EXE) which will search through the related registry on the target machine.

Then you can add this search to the prerequisite install condition, the Search done by a custom executable option. This option enables you to specify your own EXE file. The setup will interpret the result based on the return code of your EXE. In case of the EXE doesn't find the related registry entries, the returned value must be 0. Any other value will be interpreted as failure.

Also, if the return code of your EXE will be 0, the property assigned in the AI_AppSearchEx table from the Table Editor page will be set, otherwise it will not be set, it will be empty.
Since the property will be set when the prerequisite needs to be installed too, then you can use this property from the AI_AppSearchEx table which has been assigned to the search operation in the Show only if... option to display the related dialog.

You can take a look on the How to search in registry using C# thread which may be useful to you.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”