[wix-users] Change installation path of a shared component

Rob Mensching rob at firegiant.com
Mon Dec 26 09:41:08 PST 2022


> 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