我有一个MSI来安装一些服务。我更改了其中一个名称并在Wix文件中更新了引用。MSI安装程序中更新的服务名称并重新安装/升级时出错
它工作正常,当我刚刚安装它作为新鲜的微星。然而,当有升级方案(其中安装有旧的服务名称MSI和我尝试安装这个新的MSI具有服务名称改变的一个),我收到以下错误:
这里有什么提示吗?我只是在.wxs文件中重命名。我是否必须使用现有的组件ID卸载旧的组件,并用新的组件ID命名新组件ID?
当前,使用带有新名称的旧组件ID。
旧程序的部分代码:
<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>
从新的代码代替:
<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>
您可以重命名在更新设置服务文件?如果可以,请尝试重命名服务文件并为其指定一个新的组件GUID。 –
重大升级还是小升级? –
@SteinÅsmul编辑我的帖子并添加了代码。 – Atihska