maxt
Posts: 15
Joined: Fri Mar 24, 2006 12:19 am

Copy files based on Registry entry

Hi

I have installed a 3rd party package (Apache Tomcat actually) and know the Registry entry where it has been installed. How can I copy my application files to sub-folders below the Tomcat folder.

Max
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi Max,

This can be achieved very easy.

- First schedule a registry search for the value that contains the installation path. Advanced Installer comes with a wizard that will allow you to set up this search in notime.

- Now go to the "Files and Folders" page and create a new property based folder using the resulted search property. Under this folder create the desired structure of subfolders and add the needed files.

Please let me know if you encounter any problems.

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
maxt
Posts: 15
Joined: Fri Mar 24, 2006 12:19 am

Copy files based on Registry entry

Hi again

I have searched for the registry path to a folder and put the path in the RESULT_FOLDER property. I have tried all 3 options: path to a folder, path to a file and raw value.

RESULT_PROPERTY contains:
C:\Program Files\Apache Software Foundation\Tomcat 5.0
and below this are folders to which I wish to copy files.

When creating a new property based folder using RESULT_PROPERTY by right clicking in Application Folder, on selecting User defined, RESULT_PROPERTY, I get an Exception.

What am I missing?

Thanks

Max
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi Max,

The problem you are encountering is due to a bug present in the 3.8 version of Advanced Installer. It has been fixed in AI 3.8.1.

Please upgrade to the latest version an there shouldn't be any more problems.

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
maxt
Posts: 15
Joined: Fri Mar 24, 2006 12:19 am

Copy files based on Registry entry

Hi again

Thanks for that. Have now 3.8.1.

Which of the 3 search options should I use?

Thanks

Max
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

It is recommended that you choose the value to be interpreted as a path to a file or folder only if are sure that the path can be resolved on the target machine. This is because Windows Installer will return the null value as the search result if it cannot resolve that path even if the search is successful.

So I would go with the "Retrieve the raw value" option.

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Optional folders

I have a similar situation. We have a plug-in for a product that can have multiple versions installed side-by-side. We want to install into all those versions. There's a key for the default version which we use both for a launch condition and a property-based folder.

There are then a whole set of registry keys which may or may not exist on the target machine. I would like to set up property-based folders that only install if the property is true. Is that the way things are supposed to work automatically?

Also, will there be any problem if one of these optional property-based folder duplicates the mandatory property-based folder? It will be the same file in any case, but the user should not see any complaints about duplicate copies.

Thanks for your help. I'm evaluating moving to Advanced Installer and so far things are looking very promising!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

First of all you must define for each version of your program a property on "Install Parameters" page with an initial value (valid path for ex: "c:\").
We want to install into all those versions. There's a key for the default version which we use both for a launch condition and a property-based folder.
If every version of the application has an entry in the registry which specifies the location where the application is installed then in your plug-in project create a registry search for every possible installed version. The result of each search will be maintained in a Property.
I would like to set up property-based folders that only install if the property is true. Is that the way things are supposed to work automatically?
No, if the search is not successful then the "Property Based" folder is still created under the root folder of one of the available drives. Therefore in the "Organization" page set a condition for all the components associated with the files from the "Property Based" folder as follows: (were "c:\" is the initial value of the property that you set on "Install Parameters" page)

Code: Select all

RESULT_PROPERTY <> "c:\"
Also, will there be any problem if one of these optional property-based folder duplicates the mandatory property-based folder? It will be the same file in any case, but the user should not see any complaints about duplicate copies.
I don't fully understand what you are trying to say with mandatory property based folder. Give me more details about this.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Last edited by gigi on Wed Apr 26, 2006 11:54 am, edited 2 times in total.
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Hi Gigi,

Thanks for your prompt help! That sounds simple enough to set up.

Regarding the mandatory vs. optional folders. Let's say we have three properties:

- MYAPPDEFAULT for the path of the default version
- MYAPPV1 for the path of the product's V1 release, if present
- MYAPPV2 for the path of the product's V2 release, if present

MYAPPDEFAULT is used in a launch condition for the installer. I will now use MYAPPV1 and MYAPPV2 in conditions for their components.

What happens if MYAPPDEFAULT = MYAPPV1? Does the same file get installed twice? That is no problem as long as the installer does not complain or get confused.

But since I am adding a condition to the components anyway, I would guess that it would be best to add a second test to the condition. This would check to make sure that MYAPPV1 is not equal to MYAPPDEFAULT. Does that seem right?

Thanks again!
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The MYAPPDEFALUT property refers to the first version (MYAPPDEFAULT = MYAPPV1) so you don't need to define a property like MYAPPDEFAULT since you have defined a property MYAPPV1 for the first version of your program.

As a launch condition use:

Code: Select all

MYAPPV1 OR MYAPPV2
Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

I thought I had this solved, but testing shows that I haven't...

I have several directory properties defined in the Search page. All search the registry for a file name. One of them is the MYAPPDEFAULT property, which looks up something like.

HKLM\Software\Vendor\DefaultVersion

The others like MYAPPV3 and MYAPPV4 look up something like

HKLM\Software\Vendor\V3
HKLM\Software\Vendor\V4

I need both tests because there are earlier V1 and V2 versions of the software that don't have the latter entry in the registry. But all versions that we support set the first entry.

I use MYAPPDEFAULT as a launch condition and that works fine. But when I use

MYAPPV3 AND (MYAPPV3 ~<> MYAPPDEFAULT)

as a component condition in the Organization page, that does not work. The component is always installed, going into a directory based on the DefaultDir listed in the .AIP file if not present in the registry.

I'm probably missing something simple. How do I get the results of the search box to work as component conditions like I am already getting it to work for launch conditions?

This is with version 4.0.

Thanks for any further help!

Michael
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Michael,

Your application is installed side by side and you have a plug-in that must be installed in all version of your application. Here is my suggestion on how to do this:

Each version of your application write in the registry the path where it's installed. Now when you create the plug-in project define for all versions a property in the "Install Parameters" page with a default value like "c:\". For ex:

Code: Select all

MYAPPV3  c:\
MYAPPV4  c:\
Switch to "Search" page and schedule a registry search for all versions of your application. Note that the search property must have same name like corresponding property in the "Install Parameters" page (MYAPPV3, MYAPPV4, etc).

In the "Files and Folders" create a property based folder for each property defined in the "Install Parameters" page. Under this property based folder create your plugin directory (ex: "Plugins"). Make this folder synchronized with the folder which contains the files that you want to install with the plugin.

In the "Organization" page conditions all components (for each version) with the following condition:

Code: Select all

RESULT_PROPERTY ~<> "c:\"
RESULT_PROPERTY is the corresponding search property defined in the "Install Parameters" page (MYAPPV3, MYAPPV4, etc) and "c:\" it's default value.

As launch condition for the plugin application use:

Code: Select all

MYAPPV1 ~<> "c:\" OR MYAPPV2 ~<> "c:\" OR ....
If this is not what you want please let me know.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Thanks, Gigi! That's just what I want and it seems to be working fine now.

The step I had missed was to create the properties on the Install Parameters page first. I originally created them directly on the System Search page, and then found I could not add them on the Install Parameters page later. So I started with a fresh project and followed your instructions. The only complicated part of the installation is getting all these component launch conditions right, so there was not a lot of rework needed beyond what was needed to fix this anyway.

Thanks again for the outstanding technical support that you and your colleagues have offered in getting us up and running with Advanced Installer.

Michael
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: Copy files based on Registry entry

My previous version of this post regarding a problem with this technique was a false alarm. We were missing some conditions on some components that had been there in a previous version of our installer.

Michael

Return to “Common Problems”