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

Paul Shmakov paul.shmakov at gmail.com
Mon Dec 26 06:30:36 PST 2022


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


More information about the wix-users mailing list