设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 手机 数据
当前位置: 首页 > 服务器 > 系统 > 正文

Wix:升级时有时会卸载Windows服务

发布时间:2021-01-06 11:47 所属栏目:52 来源:网络整理
导读:我们用Wix安装我们的软件.我们的设置还安装了 Windows服务.要允许用户更改Windows服务的登录信息,我们只想在首次安装时安装该服务,并仅在卸载时将其删除.对于升级,我们手动停止服务,以便可以升级文件. 我们有这个工作,但最近我们发现在某些机器上,在Unpublis

我们用Wix安装我们的软件.我们的设置还安装了 Windows服务.要允许用户更改Windows服务的登录信息,我们只想在首次安装时安装该服务,并仅在卸载时将其删除.对于升级,我们手动停止服务,以便可以升级文件.

我们有这个工作,但最近我们发现在某些机器上,在UnpublishFeatures期间卸载了Windows服务:

如果失败的升级日志:

Action 13:41:38: UnpublishFeatures. Unpublishing Product Features
MSI (s) (D8:EC) [13:41:38:346]: Executing op: FeatureUnpublish(Feature=Main,Absent=2,Component=
UnpublishFeatures: Feature: Main
MSI (s) (D8:EC) [13:41:38:346]: Note: 1: 1402 2: UNKNOWN\Installer\Features\84B659030632F794E93A7CB19A87DB8E 3: 2 
MSI (s) (D8:EC) [13:41:38:346]: Executing op: ActionStart(Name=StopServices,Description=Stopping services,Template=Service: [1])
Action 13:41:38: StopServices. Stopping services
MSI (s) (D8:EC) [13:41:38:362]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (D8:EC) [13:41:38:362]: Executing op: ServiceControl(,Name=RidderIQWebApi,Action=2,Wait=1,)
StopServices: Service: Ridder iQ Web API
MSI (s) (D8:EC) [13:41:38:393]: Executing op: ActionStart(Name=DeleteServices,Description=Deleting services,Template=Service: [1])
Action 13:41:38: DeleteServices. Deleting services
MSI (s) (D8:EC) [13:41:38:393]: Executing op: ProgressTotal(Total=1,ByteEquivalent=1300000)
MSI (s) (D8:EC) [13:41:38:393]: Executing op: ServiceControl(,Action=8,)
DeleteServices: Service: Ridder iQ Web API

这来自成功升级的日志:

Action 11:53:24: UnpublishFeatures. Unpublishing Product Features
MSI (s) (CC:3C) [11:53:24:976]: Executing op: FeatureUnpublish(Feature=Main,Component=
UnpublishFeatures: Feature: Main
MSI (s) (CC:3C) [11:53:24:977]: Note: 1: 1402 2: UNKNOWN\Installer\Features\84B659030632F794E93A7CB19A87DB8E 3: 2 
MSI (s) (CC:3C) [11:53:24:978]: Executing op: ActionStart(Name=RemoveFiles,Description=Removing files,Template=File: [1],Directory: [9])
Action 11:53:24: RemoveFiles. Removing files

如您所见,Windows Installer会跳过StopServices / DeleteServices操作并开始删除文件.由于稍后在安装期间在UnpublishFeatures上删除了该服务,因此它会尝试配置该服务,但由于不再安装该服务而失败:

MSI (s) (D8:68) [13:42:34:772]: Executing op: CustomActionSchedule(Action=ExecServiceConfig,ActionType=3073,Source=BinaryData,Target=ExecServiceConfig,CustomActionData=)
MSI (s) (D8:90) [13:42:34:772]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI170B.tmp,Entrypoint: ExecServiceConfig
ExecServiceConfig:  Error 0x80070424: Service 'RidderIQWebApi' does not exist on this system.
ExecServiceConfig:  Error 0x80070424: Failed to get service: RidderIQWebApi
CustomAction ExecServiceConfig returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 13:42:35: InstallFinalize. Return value 3.

我的猜测是,这是因为组件的操作对于两个升级都是不同的,对于失败的升级,这些是组件操作:

MSI (s) (D8:68) [13:41:26:400]: Component: cmp.SR.SDKWebAPI.Service.exe; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (D8:EC) [13:41:36:400]: Component: cmp.SR.SDKWebAPI.Service.exe; Installed: Local;   Request: Absent;   Action: Absent

为了成功升级,这些是组件操作:

MSI (s) (CC:44) [11:53:17:386]: Component: cmp.SR.SDKWebAPI.Service.exe; Installed: Absent;   Request: Local;   Action: Local
MSI (s) (CC:3C) [11:53:22:850]: Component: cmp.SR.SDKWebAPI.Service.exe; Installed: Local;   Request: Absent;   Action: FileAbsent

正如您所看到的,升级失败的操作是“缺席”,而成功升级的操作是FileAbsent.据我所知,FileAbsent意味着重新安装了该功能,而Absent意味着该功能将被删除.

我的问题是如何确定组件的操作,以及为什么它在一台机器上缺席并在另一台机器上FileAbsent.有没有办法解决这个问题?

组件如果配置如下:

<Component Id="cmp.SR.SDKWebAPI.Service.exe" Guid="">
    <File Id="fil.SDKWebAPI.Service.exe" Source="SDKWebAPI.Service.exe" KeyPath="yes" />
    <File Id="fil.SDKWebAPI.Service.exe.config" Source="SDKWebAPI.Service.exe.config" KeyPath="no" />
    <ServiceInstall Id="SDKWebAPI.Service.exe.Installer"
                    Type="ownProcess"
                    Name="RidderIQWebApi"
                    DisplayName="Ridder iQ Web API"
                    Description="Ridder iQ Web API service"
                    Start="auto"
                    Account="LocalSystem"
                    ErrorControl="ignore">
      <util:ServiceConfig FirstFailureActionType="restart" 
                          SecondFailureActionType="restart"
                          ThirdFailureActionType="restart"
                          RestartServiceDelayInSeconds="60" 
                          ResetPeriodInDays="0" />
    </ServiceInstall>
  </Component>

解决方法

空白组件GUID:Guid =“”这是您最近设置的内容吗?我相信,这将为组件设置一个空白的GUID,这意味着它将在第一次安装时安装,之后从未接触或升级(除非您在升级时找到了重新安装组件的技巧) – 并且它不会据我记得,已卸载.

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读