0
votes

I have an installer that doesn't seem to be following MSI component rules at install time. Here's the scenario:

OS: Windows 7 x64

Product A installs a set of files attached to a component with guid "123ABC" into C:\Program Files\Common Files\Foo. The component has the following files:
foo.dll, version 1.0.0.0, (KeyPath)
foo.sys, version 1.0.0.0
foo.inf, no version
foo.cat, no version

Product B installs the same set of files attached to the same component guid "123ABC" into the same path C:\Program Files\Common Files\Foo. The component has the following files:
foo.dll, version 1.0.0.1, (KeyPath)
foo.sys, version 1.0.0.0
foo.inf, no version
foo.cat, no version

Product A is installed first, and product B does not perform an upgrade of product A, they just share a common MSM that contains the component "123ABC". My expectation is that when product B is installed, MSI will compare the keypath versions of foo.dll and determine that product B's foo.dll is newer. Then all four files associated with component "123ABC" will overwrite the existing files on disk that were installed by product A. This is not happening :( Instead, this is the resulting fileset:
C:\Program Files\Common Files\Foo
foo.dll, version 1.0.0.1 (From product B)
foo.sys, version 1.0.0.0 (From product A)
foo.inf, no version (From product A)
foo.cat, no version (From product B)

Only the dll and the cat file are overwritten. From the msi log file I can see the following:

MSI (s) (4C:F0) [17:29:24:227]: File: C:\Program Files\Common Files\Foo\foo.dll;    Overwrite;  Won't patch;    Existing file is a lower version
MSI (s) (4C:F0) [17:29:24:305]: File: C:\Program Files\Common Files\Foo\foo.sys;    Won't Overwrite;    Won't patch;    Existing file is of an equal version
MSI (s) (4C:F0) [17:29:24:305]: File: C:\Program Files\Common Files\Foo\foo.inf;    Won't Overwrite;    Won't patch;    Existing file is unversioned and unmodified - hash matches source file
MSI (s) (4C:F0) [17:29:24:335]: File: C:\Program Files\Common Files\Foo\foo.cat;    Overwrite;  Won't patch;    Existing file is unversioned and unmodified - hash doesn't match source file

I thought MSI components installed all associated files based on whether or not the keypath is to be installed. What could cause every file associated with the same component to be individually compared?

2
Mark the component in the merge module as shared and rebuild all and retest.Christopher Painter
Are you talking about msidbComponentAttributesShared or msidbComponentAttributesSharedDllRefCount? Either way I don't see what setting either would buy me? Also, we're using MSI 3.0.jbudreau

2 Answers

1
votes

Keypath state determines whether a component will be acted on. Resources within the component then follow their rules: e.g., files follow the file versioning rules.

0
votes

Assuming each product is using default costing rules (OMUS) Merge modules containing shared components should work. FWIW, you might want to consider making an MSI that consumes this merge module and then add it to a bootstrapper for both products. Patch servicing can be cleaner this way.