2

尝试使用 Windows 服务配置的新 MSI 5.0 功能(使用表:MsiServiceConfig / MsiServiceConfigFailureActions)安装安装程序包时,服务配置失败并导致回滚。

该服务本身与“LocalSystem”帐户下的相同软件包一起安装。关于 MSDN,这些功能确实有一些限制,但我不确定它们是否适用于这里:

“Windows Installer 的服务配置功能无法配置网络服务帐户、安装共享服务主机 (svchost) 进程或重新启动在安装过程中停止的服务”(请参阅​​ http://msdn.microsoft.com/en-us/库/windows/desktop/dd408113(v=vs.85).aspx )

我已经尝试了对失败操作计数和类型的几种变体。使用 SC_ACTION_NONE 或 SC_ACTION_RUN_COMMAND 操作确实有效并导致安装成功。

你能告诉我,为什么 SC_ACTION_RESTART 或 SC_ACTION_REBOOT 不能正常工作吗?

MSI 日志文件摘录:

Action 08:21:51: InstallServices. Installing new services
MSI (s) (78:74) [08:21:51:828]: Executing op: ProgressTotal(Total=5,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:51:859]: Executing op: ServiceInstall(Name=PCSProxy,DisplayName=Protection Communication System Proxy,ImagePath="C:\Program Files (x86)\Protection Communication System\Pcs.Proxy.Service.exe",ServiceType=16,StartType=2,ErrorControl=32769,,Dependencies=[~],,,Password=**********,Description=Provides limited write access to the PPS,,)
InstallServices: Service: 
MSI (s) (78:74) [08:21:52:218]: Executing op: ActionStart(Name=MsiConfigureServices,,)
Action 08:21:52: MsiConfigureServices. 
MSI (s) (78:74) [08:21:52:280]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:52:280]: Executing op: ServiceConfigure(,Name=PCSProxy,Event=1,ConfigType=4,Argument=1)
MSI (s) (78:74) [08:21:52:280]: Changing configuration of service PCSProxy.
MSI (s) (78:74) [08:21:52:280]: Changed configuration of service PCSProxy with ConfigType SERVICE_CONFIG_FAILURE_ACTIONS_FLAG
MSI (s) (78:74) [08:21:52:358]: Done changing configuration of service PCSProxy
MSI (s) (78:74) [08:21:52:358]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (78:74) [08:21:52:358]: Executing op: ServiceConfigureFailureAction(,Name=PCSProxy,Event=1,ResetPeriod=259200,RebootMessage=Rebooting the system,Command=cmd.exe,Actions=1[~]2[~]3,DelayActions=60000[~]60000[~]60000)
MSI (s) (78:74) [08:21:52:374]: Changing configuration of failure action for service PCSProxy.
MSI (s) (78:74) [08:21:52:374]: Error: 5. Failed to change current configuration of failure action for service PCSProxy
MSI (s) (78:74) [08:21:52:374]: Failed to change configuration of failure action for service PCSProxy
Error 1939. Service 'Protection Communication System Proxy' (PCSProxy) could not be configured.  This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.
MSI (s) (78:74) [08:22:04:791]: Product: Protection Communication System -- Error 1939. Service 'Protection Communication System Proxy' (PCSProxy) could not be configured.  This could be a problem with the package or your permissions. Verify that you have sufficient privileges to configure system services.

Action ended 08:22:04: InstallFinalize. Return value 3.

[...]

Property(C): VersionNT = 602
Property(C): VersionDatabase = 500
Property(C): VersionMsi = 5.00
Property(C): VersionNT64 = 602
Property(C): WindowsBuild = 9200
Property(C): ServicePackLevel = 0
Property(C): ServicePackLevelMinor = 0
Property(C): MsiNTProductType = 3
Property(C): UserLanguageID = 1031
Property(C): ComputerName = WIN-D4AOTTU5CRV
Property(C): SystemLanguageID = 1031
Property(C): Time = 07:33:17
Property(C): Date = 18.04.2013
Property(C): MsiNetAssemblySupport = 4.0.30319.17929
Property(C): MsiWin32AssemblySupport = 6.2.9200.16384
4

0 回答 0