I have an MSI that installs some services. I changed the name for one of them and updated references in Wix files.
It works fine when I just install it as fresh MSI. However, when there is an upgrade scenario (where MSI is installed with the old service name and I try to install this new MSI that has one of the service name changed), I get the following error:
Any hints here? I am just renaming in .wxs files. Do I have to uninstall the old one with the existing component id and name the new one with new component id?
Currently, using the old component id with a new name.
SOME PART OF OLD CODE:
<Directory Id="dirxxx" Name="oldname">
<!-- oldname service-->
<Component Id="cmpOldNameService" Guid="bbb"
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="no" Location="either">
<RemoveFile Id="ccc" On="uninstall" Name="z.dll"/>
<File Id="ccc" KeyPath="no" Source="$(var.xSource)\OldNameService\a.dll"/>
<File Id="ddd" KeyPath="no" Source="$(var.xSource)\OldNameService\b.dll"/>
<File Id="eee" KeyPath="no" Source="$(var.xSource)\OldNameService\c.dll"/>
<File Id="fff" KeyPath="no" Source="$(var.xSource)\OldNameService\d.dll"/>
<File Id="ggg" KeyPath="no" Source="$(var.xSource)\OldNameService\e.dll"/>
<File Id="hhh" KeyPath="no" Source="$(var.xSource)\OldNameService\f.dll"/>
<File Id="iii" KeyPath="yes" Source="$(var.xSource)\OldNameService\g.exe"/>
<File Id="jjj" KeyPath="no" Source="$(var.xSource)\OldNameService\h.dll"/>
<File Id="kkk" KeyPath="no" Source="$(var.xSource)\OldNameService\i.dll"/>
<ServiceInstall Id="OldNameService" DisplayName="OldName Service" Name="NewName"
ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes" Description="OldName Service">
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall="yes"/>
</ServiceInstall>
<ServiceControl Id="OldNameServiceControl" Name="NewName"
Start="install" Stop="uninstall" Remove="uninstall" Wait="no"/>
</Component>
<Component Id="lll" Guid="mmm" NeverOverwrite="yes">
<File Id="nnn" KeyPath="yes" Source="$(var.xSource)\OldNameService\OldName.exe.config"/>
<util:XmlFile Id="UpdateOldNamelogFileName"
File="[#nnn]"
Action="setValue"
ElementPath="/configuration/appSettings/add[\[]@key='logFile'[\]]/@value"
Value="[ooo]oldname_YYYYMM.log" />
</Component>
REPLACED WITH NEW CODE:
<Directory Id="dirxxx" Name="newname">
<!-- newname service-->
<Component Id="cmpNewNameService" Guid="bbb"
SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
Win64="no" Location="either">
<RemoveFile Id="ccc" On="uninstall" Name="z.dll"/>
<File Id="ccc" KeyPath="no" Source="$(var.xSource)\NewNameService\a.dll"/>
<File Id="ddd" KeyPath="no" Source="$(var.xSource)\NewNameService\b.dll"/>
<File Id="eee" KeyPath="no" Source="$(var.xSource)\NewNameService\c.dll"/>
<File Id="fff" KeyPath="no" Source="$(var.xSource)\NewNameService\d.dll"/>
<File Id="ggg" KeyPath="no" Source="$(var.xSource)\NewNameService\e.dll"/>
<File Id="hhh" KeyPath="no" Source="$(var.xSource)\NewNameService\f.dll"/>
<File Id="iii" KeyPath="yes" Source="$(var.xSource)\NewNameService\g.exe"/>
<File Id="jjj" KeyPath="no" Source="$(var.xSource)\NewNameService\h.dll"/>
<File Id="kkk" KeyPath="no" Source="$(var.xSource)\NewNameService\i.dll"/>
<ServiceInstall Id="NewNameService" DisplayName="NewName Service" Name="NewName"
ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes" Description="New Name Service">
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall="yes"/>
</ServiceInstall>
<ServiceControl Id="NewNameServiceControl" Name="NewName"
Start="install" Stop="uninstall" Remove="uninstall" Wait="no"/>
</Component>
<Component Id="lll" Guid="mmm" NeverOverwrite="yes">
<File Id="nnn" KeyPath="yes" Source="$(var.xSource)\NewNameService\NewName.exe.config"/>
<util:XmlFile Id="UpdateNewNamelogFileName"
File="[#nnn]"
Action="setValue"
ElementPath="/configuration/appSettings/add[\[]@key='logFile'[\]]/@value"
Value="[ooo]newservice_YYYYMM.log" />
</Component>