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.
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?
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.
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.
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.
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.
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?
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?
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.