mkoe
Posts: 12
Joined: Tue Sep 11, 2012 10:29 am

Multiple packages with shared files

Hello,
we need help authoring our installers for multiple projects. The scenario is the following:

We have two products:
  1. Product A
  2. Product B
And we have two sets of files which are bundled into modules:
  1. Module A
  2. Module B
These modules consist of arbitrary files, like text, scripts, DLLs, assemblies, assembly policies, XML and so on. All these files are stored in a same shared directory.

Dependencies are:
  • Product A: Module A
  • Product B: Module A, Module B
At the moment, a side-by-side installation of different versions of the same product is not allowed. But:
  • Product A uses Version 1.1.2 of Module A
  • Product B uses Version 1.1.3 of Module A
Since our modules are backward compatible from 1.1.3 to 1.1.2, this shouldn't be a problem.
Product A and Product B are Installer Packages and Module A and Module B are Merge Modules. If we update files in Module A which do NOT afflict Product A BUT Product B, we only build a new version of Product B.

Now our big problem:
If we first install Product B with Module A in Version 1.1.3 and after that Product A with Module A in Version 1.1.2, all files from Module A which haven't a file version are overwritten and get incompatible to Product B. All DLLs with a file version are kept because they have a higher version (1.1.3 compared to 1.1.2).

Advanded Installer has the feature to set a file version for arbitrary files. But after some testing it does not seem to work.

The question is: What structure is the best for our scenario?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Multiple packages with shared files

Hello,
Since our modules are backward compatible from 1.1.3 to 1.1.2, this shouldn't be a problem.
In this kind of scenario it is recommended to use the latest version of your merge module in both of your products.
Now our big problem:
If we first install Product B with Module A in Version 1.1.3 and after that Product A with Module A in Version 1.1.2, all files from Module A which haven't a file version are overwritten and get incompatible to Product B. All DLLs with a file version are kept because they have a higher version (1.1.3 compared to 1.1.2).

Advanded Installer has the feature to set a file version for arbitrary files. But after some testing it does not seem to work.
This happens because when comparing the existing file with the one from your package, Windows Installer doesn't detect the user specified version of the existing file (the existing file it is detected as unversioned). Only the file from current package is detected as a versioned file and, in this case the existing file it will be always overwritten. Also, you can take a look on "File Versioning Rules (Windows)" article which should be useful for you.
The question is: What structure is the best for our scenario?
In order to achieve what you want you should enable the "Make companion of file" option from "Folder Properties -> Version" tab. In this field you can select a versioned file within your merge module.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mkoe
Posts: 12
Joined: Tue Sep 11, 2012 10:29 am

Re: Multiple packages with shared files

Thanks for your response,

with the "Make companion of file" option older files won't be overwritten. But what happens to registry entries?
It is possible to install ALL components of a merge module ONLY if a certain DLL of the merge module has a higher version than the existing one?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Multiple packages with shared files

Hello,

Unfortunately we don't have predefined support for this. However, in order to achieve this you can create your own custom action which will search for the installed DLL version, will compare it with current DLL and will set the result in an installer property. Then, you can use the above property in the "Condition" field, from "Component Properties" pane, of the related components.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Lena
Posts: 7
Joined: Thu Jan 09, 2014 1:31 pm

Re: Multiple packages with shared files

Hello,

how can I access the file version of the file inside the msi
(to compare it with the Version of the file already installed) in a vbs?


Regards

Lena
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Multiple packages with shared files

Hello Lena,

You can set (at build time) an installer property with version of the file included in the current package. Then, you can access at install time within your custom action the above property value.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”