[wix-users] Change installation path of a shared component
Paul Shmakov
paul.shmakov at gmail.com
Mon Dec 26 11:05:45 PST 2022
Thank you for the prompt response, Rob!
> Follow the old location if it exists (ComponentSearch?) and install to new location if old location does not exist.
Correct me if I'm wrong:
1. It works if you install a new version of product A on a machine
where an old version of product B is installed. A's installer executes
ComponentSearch to determine the correct path.
2. It does not work if you install an old version of B on a machine
with a new version of A. B will install a second copy, at the old
location.
I wonder if there is some clever trick that also solves problem #2. In
our case both scenarios are possible.
> No. Path of the Component can change. Shape of the Component cannot.
Do you mean that if all the products start using the new path, that's
a legitimate way to change the path of a shared component?
I mean that we cannot change the installation path because it will
also change the key path of the shared component, which seems to be a
critical violation according to
https://devblogs.microsoft.com/setup/about-shared-components/.
Thanks!
On Mon, Dec 26, 2022 at 9:41 PM Rob Mensching <rob at firegiant.com> wrote:
>
> > There is a strong desire to change the installation path of the component to %ProgramFiles%\BAR Company\BAR Component. I.e. the company name changes.
>
> Follow the old location if it exists (ComponentSearch?) and install to new location if old location does not exist.
>
> > My understanding is that we cannot just change the installation path of the component, because it will break the MSI rule that the component's ID and Path must not change.
>
> No. Path of the Component can change. Shape of the Component cannot.
>
> > Having two copies of the service does not work either - we can have only a single Windows service with the predefined name.
>
> True. Windows limitation.
>
>
>
> -----Original Message-----
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Paul Shmakov via wix-users
> Sent: Monday, December 26, 2022 6:31 AM
> To: wix-users at lists.wixtoolset.org
> Cc: Paul Shmakov <paul.shmakov at gmail.com>
> Subject: [wix-users] Change installation path of a shared component
>
> Hello everyone!
>
> What would be the right way to change an installation path of a shared component?
>
> AS IS
> There is a shared component which is a Windows service (MyServiceName) installed into %ProgramFiles%\FOO Company\FOO Component.
> There can be only a single instance of the service on a machine, with the predefined name (MyServiceName), as it controls a device.
>
> The component is included into 3 products (A, B, and C). There are lots of old released versions of these products. Different combinations of the products can be installed on the same machine: new A and new B; old A and new B; new A and old B; etc.
>
> The service is packaged as a WIX library.
> <DirectoryRef Id="COMP_INSTALLLOCATION">
> <Component Id="MySharedComponentId" Guid="12345" >
> <File Id="Service.exe" Name="Service.exe" KeyPath="yes"
> Checksum="yes" />
> <ServiceInstall Name="MyServiceName" ErrorControl="normal"
> Interactive="no" Start="demand" Type="ownProcess" Vital="yes" />
> <ServiceControl Id="ServiceControl" Name="MyServiceName"
> Stop="both" Remove="uninstall" />
> </Component>
> </DirectoryRef>
>
> TO BE
> There is a strong desire to change the installation path of the component to %ProgramFiles%\BAR Company\BAR Component. I.e. the company name changes.
>
> New versions of the products will be released with the updated installation path. However, there are still lots of older versions out there. We want to preserve compatibility, so a new version of product A should work correctly with an old version of product B - there still needs to be a single Windows service with the same old name.
>
> My understanding is that we cannot just change the installation path of the component, because it will break the MSI rule that the component's ID and Path must not change.
> Having two copies of the service does not work either - we can have only a single Windows service with the predefined name.
>
> I'd really appreciate it if you could share your ideas on possible solutions for this case.
>
> Thanks,
> Paul
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list