J'ai un MSI qui installe certains services. J'ai changé le nom pour l'un d'entre eux et mis à jour les références dans les fichiers Wix.Erreur lors de la mise à jour du nom du service dans MSI Installer et réinstallé/mis à niveau
Cela fonctionne très bien quand je l'installe simplement comme MSI frais. Cependant, quand il y a un scénario de mise à niveau (où MSI est installé avec l'ancien nom du service et je tente d'installer ce nouveau MSI qui a l'un des noms de service changé), je reçois l'erreur suivante:
Des indices ici? Je suis juste en train de renommer les fichiers .wxs. Dois-je désinstaller l'ancien avec l'identifiant du composant existant et nommer le nouveau avec l'identifiant du nouveau composant?
Actuellement, en utilisant l'ancien ID de composant avec un nouveau nom.
QUELQUES PARTIE DU VIEUX 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>
REMPLACE AVEC UN NOUVEAU 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>
Pouvez-vous renommer le fichier de service dans la configuration de mise à jour? Si vous le pouvez, essayez de renommer le fichier de service ET donnez-lui un nouveau GUID de composant. –
Mise à niveau majeure ou mise à jour mineure? –
@ SteinÅsmul a modifié mon message et ajouté du code. – Atihska