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

One file, multiple locations, one copy in the MSI?

Our product is a plug-in for a program that can run many side-by-side versions. We automatically install the plug-in in each location that we find. This has worked very well using conditions for each separate installation that might be in place. The installer currently has a new folder / file setup for each condition.

The problem is that, with our new version, the size of the plug-in has grown, as has the number of possible versions. The plug-in is about 1 MB, and there are 12 possible versions. In our current installer, each possible copy is included in the installer. So even though the same 1 MB file is being installed in up to 12 places, it is being included 12 times. These extra 11 MB triple the size of the installer.

Is there a way to reduce this overhead? I would like to include the file just once in the .msi file, but let it be installed in multiple places. Any pointers to how to do this would be most appreciated.

Thanks for any help you can offer!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can use the File Duplication feature in the "Files and Folders" page. For example: if you have the file "test.exe", while pressing the "Shift" key, you drag and drop the file in the folders you want, creating a duplicate for the file.

Regards,
cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Thanks so much, Cosmin - this is just what I needed.

I had trouble with the drag and drop. It created files with a "Duplicate of" name, and renaming them all to be the same file name caused confusion. Perhaps things weren't going into the components that I was expecting them to.

Going to each component and then choosing the file duplication from the toolbar worked fine. That way I could control everything I needed - both the file name and the component for conditional installation - when creating the duplication the first time. The file duplication dialog helpfully remembered the file I last selected to duplicate, which saved time.

Two things might make the file duplication dialog work even more smoothly:

1) If I am doing the file duplication and currently have a component folder selected in the files and folders view, could that component be made the default in the Component drop-down in the New File Duplication dialog?

2) Could the components in the New File Duplication drop-down be sorted in alphabetical order?

Thanks again for such a wonderful product and such terrific support!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
1) If I am doing the file duplication and currently have a component folder selected in the files and folders view, could that component be made the default in the Component drop-down in the New File Duplication dialog?

2) Could the components in the New File Duplication drop-down be sorted in alphabetical order?
We have added these features on our TODO list and they will be available in a future version. Thank you for your suggestion! Until then, you can use the "Shift" key while you drag-and-drop the file (in this case the component of the file is selected automatically)

Regards,
cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: One file, multiple locations, one copy in the MSI?

I am having a new problem with file duplication. I go to the File and Folders menu, select the component I want, and then use the File Duplication tool from the toolbar. When I do this, I am given a list of components as an option - but the component I am currently in, which should be the default choice, is excluded from this list!

What I wound up doing was assigning a bogus component, then manually edited the .aip file to insert the correct component. However, these edited component assignments - along with those created a year ago when I started this - do not display the correct component in the GUI. Rather, they seem to use the first component on the drop-down list.

I saw this problem in 6.4, so I uninstalled and reverted to 6.3.1, but it was there as well. I am pretty sure that this problem wasn't in the version I was using a year ago when I originally asked this question. It would be great if this could be fixed soon so that file duplication operations do not require manual editing of the .AIP file to work and display correctly. Thanks!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: One file, multiple locations, one copy in the MSI?

Hi,
I go to the File and Folders menu, select the component I want, and then use the File Duplication tool from the toolbar. When I do this, I am given a list of components as an option - but the component I am currently in, which should be the default choice, is excluded from this list!
I'm not sure I understand what you mean. Can you please give me more details about this?
Please note that in the "Files and Folders" page you can select only files or set the current feature, you cannot select any component.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: One file, multiple locations, one copy in the MSI?

Hi Cosmin,

Our product is a plug-in for an application that allows multiple versions to run in side-by-side installations. Each time a new application version comes out (no more than once a year), we add a new file duplication to the installer. Here are the steps I am using to do this:

1) Add a new property on the Install Parameters page.
2) Add a new registry search for the property on the Search page.
3) Add a new property-based folder on the Files and Folders page.
4) We add our software two-levels below the directory in the registry, so I create two normal folders under the new property-based folder on the Files and Folders page.
5) I select the second folder, which is where the file duplication should go. Advanced Installer has automatically created a new component for this folder.
6) I go to the New File Operation button on the toolbar and select File Duplication from the drop-down menu.
7) The "Choose Installation File" dialog appears. I choose the file I want duplicated, leaving the feature filter unchanged (All Features).
8) The "New File Duplication" dialog appears. This is where I run into trouble. In the Component drop-down list, every component appears *except* the one that I want to use - the component for the selected folder.

So I select a component I do not want. I then edit the .aip file manually to specify the component that I do want. When I open the edited .aip file in Advanced Installer, the correct component does not appear. Instead, the first component in the drop-down list appears.

The installation works correctly, but it is cumbersome to work this way, and confusing when coming back to the installer once a year to add a new file duplication.

Perhaps I am misunderstanding something about how file duplication and components work, but my recollection is that I did not have this problem one year ago when setting up the initial file duplications with your help.

Let me know if you need any further details. Thanks for any assistance that you can offer!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: One file, multiple locations, one copy in the MSI?

Hi,
In the Component drop-down list, every component appears *except* the one that I want to use - the component for the selected folder.
Please note that a folder has a component only if its empty. In this case, the component of the folder will contain only the folder (nothing else).

Since you are creating a file operation in this folder, the component of the file operation should replace the component of the folder (you would select the folder component). However, in this case the file operation would be the only resource in its component. This is not supported by Windows Installer, therefore the component of the file operation cannot replace the component of the folder. Therefore, you cannot select the component of the folder which contains the file operation.

Basically, the component of the folder cannot contain other resources (like a file operation). This type of components can only be replaced by the components of the files in the folder.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: One file, multiple locations, one copy in the MSI?

Hi Cosmin,

Thank you for the clarification.

However, I am unsure how to proceed. The file duplications are based on a property. The only action taken for the property is to do a single file duplication, together with creating new folders if needed.

Our installer project was originally written using an older version of Advanced Installer. This version created a new component for each folder, and a single component for the final folder and file duplication. There was no problem creating this with Advanced Installer in the past and we have had no problems with it in our user base to date.

I am not sure how I am supposed to proceed with the newer 6.3.1 / 6.4 / 6.4.1 versions of Advanced Installer, given the needs of our setup. Any suggestions or clarifications that you could offer would be most appreciated. Thanks again for all your help!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: One file, multiple locations, one copy in the MSI?

Hi,
This version created a new component for each folder, and a single component for the final folder and file duplication.
I'm not sure to which version you are referring to. Can you please specify it so we can investigate it?

Since Windows Installer does not support what you need to do, a solution would be to use a custom action. This custom action should create the folder and create the duplicate when its condition is met.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: One file, multiple locations, one copy in the MSI?

cosmin wrote:Hi,
This version created a new component for each folder, and a single component for the final folder and file duplication.
I'm not sure to which version you are referring to. Can you please specify it so we can investigate it?
Hi Cosmin,

We used version 3.9 for the initial project, and version 4.9.2 to add new folders last year. In those versions we had actual files in the bottom-level folder, but a new component was created for the intermediate folders as well. We changed the redundant files to file duplications using version 5.1.1 based on your advice from earlier in this thread.

This has all been working fine in the field for more than 2 years, as well as in our testing here. So I think we will keep this for now and consider custom actions should we get problem reports in the future. Thanks again for your assistance!
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: One file, multiple locations, one copy in the MSI?

Hi Cosmin,

We are now working on an installer for another plug-in product that needs to optionally install into multiple versions of the parent product. Using version 6.9.1, it looks like things are working differently now. Components are no longer being created for the intermediate folders, and we no longer need to use the file duplication operation. A file placed in two different components appears to only be included once in the installer.

Is my understanding of these changes correct? If so, these are very nice additions that will make building our installers even easier to build and deploy in the future.

Thanks for all the continued great work on Advanced Installer!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: One file, multiple locations, one copy in the MSI?

Hi,
Components are no longer being created for the intermediate folders
Please note that you can create a component for a folder by using the "Create folder on target machine" option in the Properties tab of its "Edit Folder" dialog.
A file placed in two different components appears to only be included once in the installer.
I'm afraid the same file cannot be placed in two different components. However, the component of a file can be shared between features. This way, you can have multiple features (one for each version of the parent product) and share components between them. To share a component you can drag it over another feature while pressing the SHIFT key.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
good
Posts: 20
Joined: Fri Apr 21, 2006 1:25 am

Re: One file, multiple locations, one copy in the MSI?

Hello Cosmin,

Thanks again for your help. We have a new version coming up so we are now able to create a new installer using 7.0.1 that better meets our needs than trying to do an update for the old installer.

This is a plug-in for a product that can be installed on multiple versions on the same system. If version 1 is installed, we install into the Application Data\Parent Product\Parent 1 folder. If version 2 is installed, we install into the Application Data\Parent Product\Parent 2 folder. We do registry searches to make sure that at least one of these products is installed as a prerequisite. We install our readme and other documentation in our own application folder so we can refer to it easily in the exit dialog.

Following your advice, I have created separate features for each parent product version, plus a separate feature for our documentation. I set each parent product feature to "Not installed by default", and use a different conditional install level to enable the installation of each feature. These are based on the same search properties we use in our installer prerequisite. We have no UI for setup types, since there are no options to set there. I copied the source files into the appropriate folders in the Files and Folders page, then rearranged them into the proper features and components in the Organization page.

I have tested the first draft of this installer on systems with either or both of these parent versions installed, and everything seems to be working OK, both on XP and Vista test systems.

Is there anything that you can see that I have overlooked here? You mentioned something about the same file not being able to be in two separate components. But copying the same source file to separate features that have separate installation locations seems to be working fine.

Thanks again for your assistance and for this great product!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: One file, multiple locations, one copy in the MSI?

Hi,
Is there anything that you can see that I have overlooked here?
No, everything seems to be configured correctly.
You mentioned something about the same file not being able to be in two separate components. But copying the same source file to separate features that have separate installation locations seems to be working fine.
Yes, the same file in a specific location cannot be added in two different components. However, if you have multiple copies of the file in different locations, each copy can be placed in a different component. The components (which can contain one or more files) can be organized any way you need).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”