Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Order of multiple identical search locations

Wed May 08, 2013 2:09 pm

Hello,
I use your great product AdvancedInstaller to create different Installation packages.
In one case, I need to check for an existing version.
The previous version use different registry keys which I want to check.
So I created 3 registry location search items with an identical name.
When my Installation package runs, I have no possibility to define the order of the search.
My aim is to check first for the newest version and last for the oldest version.

Is there a way to archieve this?

Thanks a lot!

Bye,
Jürgen Bauer

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of multiple identical search locations

Wed May 08, 2013 2:39 pm

Hello,

Windows Installer does not guarantee the searches order, so a new search should not use the result of another search.

You need to do your own custom action. You can use a custom action written in C# or a custom action written in C++.

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

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Wed May 08, 2013 3:19 pm

Hello,

I do not use the result of one search to use it in another.

Instead, I have the following 3 application search entries:
1. BUILDUP_LOCATION which looks after HKEY_CURRENT_USER\Software\..\BUILDUP V16\System
2. BUILDUP_LOCATION which looks after HKEY_CURRENT_USER\Software\..\BUILDUP V15\System
3. BUILDUP_LOCATION which looks after HKEY_CURRENT_USER\Software\..\BUILDUP\System

How can I archieve this?
Is this only possible with a custom action?
Do you have a sample how to do this?

Thanks a lot.

Bye,
Jürgen Bauer

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of multiple identical search locations

Thu May 09, 2013 10:09 am

Hello,

You can skip doing your own custom action because a new search doesn't use the result of another search, but you will have to add several custom actions “Set installer property”. Add 3 custom actions “Set installer property” that will set the higher version. All these three custom actions will set the same “Property” field to a value that will hold your maximum version, let's say ( MAX ). Also, for every custom action you will have to uncheck the “Uninstall” and “Maintenance” options.

The first custom action will have the “Value” of your first search name(e.g. [VERSION_17]) and the “Condition” field set to, in our example “VERSION_17”.

The second custom action will have the “Value” of your second search name (e.g. [VERSION_16] ) and the “Condition” field set to, in our example “VERSION_16 AND NOT VERSION_17”.

The third custom action will have the “Value” of your third search name (e.g. [VERSION_15] ) and the “Condition”, in our example “VERSION_15 AND NOT VERSION_16 AND NOT VERSION_17”.

This 3 custom actions were for the higher value. Now we need another 3 custom actions for the minimum version.
Add another 3 custom actions “Set installer property”, for each of them you will set the “Property” field to a value that will hold your minimum version, let's say (MIN). Also, for every custom actions you will have to uncheck the “Uninstall” and “Maintenance” options.

Do the same thing as before but for minimum version. Now all you have to do is to reverse conditions from precedent three searches for the maximum version.

Please note that all custom action must be placed in “Wizard Dialogs Stage” after the “Searches”.

Here you have a sample. I used two “Edit Box” controls to display the MIN and MAX. To to this, I set the “Property Name” of each edit box to MAX and MIN because these are the properties that hold my maximum version and my minimum version.

Best regards,
Dan
Attachments
SearchRegistryKey.aip
(12.66KiB)Downloaded 365 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Mon May 13, 2013 9:36 am

Hello, Dan,

thanks for your extensive answer.
One more question to your sample: how can I use the result for installing an update version of my program?

Normally, my destination path is set via "Install Parameters" - "Application Folder". At this place, I can only use the variables "Version 15", "Version 16" etc.

Bye,
Jürgen Bauer

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of multiple identical search locations

Mon May 13, 2013 4:19 pm

Hi Jürgen Bauer,

I'm afraid I don't fully understand what you are trying to achieve.

Can you give me a more detailed scenario?

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

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Tue May 14, 2013 8:33 am

Hello, Dan,

thanks for your reply.

I would like to update an old version of my application.
As every Version has its own registry entries (BUILDUP, BUILDUP V15 etc.), I have to test for the latest version, read the path of this version out of the registry and install the new Version in this path.

I hope that I could clarify my aim.

Bye,
Jürgen Bauer

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of multiple identical search locations

Tue May 14, 2013 10:43 am

Hello Jürgen Bauer,

In order to achieve this, you need to add another custom action “Set Property” which will set your “APPDIR” (this holds your path to your installation package) to the value of MAX.

For that you can edit the “Installer Property” of the custom action, in the “Property” field add the APPDIR, the “Value” field to [MAX] and the “Condition” field to MAX.

Make sure you add this custom action in the “Wizard Dialog Stage” after all your previous custom actions.

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

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Tue May 14, 2013 2:59 pm

Hello, Dan,

thanks for your reply.
In your demo sample the expected Destination path is correctly extracted and shown.
In my installation script the property is not filled correctly.
I looked at the log file and realized that the Custom Actions are not executed and so no property is set - in contrast to your Installation script.
Do I need a higher version of AdvancedInstaller to be able to use Custom Actions?

Bye,
Jürgen Bauer

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Tue May 14, 2013 3:08 pm

Hello, Dan,

it is always important to read the whole (!) mail :-).

My mistake was that I created my custom actions in the Execution Stage - not in the Wizard Stage.

Thanks a lot for your support!

Bye,
Jürgen Bauer

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Tue May 14, 2013 3:22 pm

Hello,

I was to fast with my reponse ...
My custom actions are still not called - even if they are positioned in the Wizard Stage area.
Is there any additional property to set?

Bye,
Jürgen

Jürgen Bauer
Posts: 8
Joined: Wed May 08, 2013 2:00 pm

Re: Order of multiple identical search locations

Tue May 14, 2013 3:47 pm

One more hello,

I solved it finally myself.
My Problem was that my custom Actions where positioned before (!) the section Searches. So they were not executed.
Now they are behind (!) the section Searches and the Destination path is correctly extracted and used for the Installation.

Bye,
Jürgen

Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Order of multiple identical search locations

Wed May 15, 2013 6:53 am

Hello Jürgen Bauer,

I'm glad you got this working.

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

Return to “Common Problems”