WiX:Can';尽管可以作为本地系统安装和启动服务,但仍不能停止服务
这是我的 特别是,我以LocalSystem用户的身份安装了一个服务,并启动了它:WiX:Can';尽管可以作为本地系统安装和启动服务,但仍不能停止服务,wix,windows-installer,uac,Wix,Windows Installer,Uac,这是我的 特别是,我以LocalSystem用户的身份安装了一个服务,并启动了它: <!-- Directory where [prey]/versions/[version] will be --> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLLOCATION" Name="Prey"> <Directory Id="Versio
<!-- Directory where [prey]/versions/[version] will be -->
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Prey">
<Directory Id="VersionsDir" Name="versions">
<Directory Id="VersionDir" Name="$(var.ProductVersion)">
<Directory Id="BinDir" Name="bin">
<Directory Id="BinWindowsDir" Name="windows">
<Component Id="CronServiceExe"
Guid="ECC25B2A-FB2E-425A-92AD-DCF1D34204FF">
<File Id="file_8FF048AD40124B9F9C07126F2C14A765"
Checksum="yes"
KeyPath="yes"
Source="source-msi\versions\0.10.0\bin\windows\cronsvc.exe" />
<ServiceInstall Id="CronServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="CronService"
DisplayName="Cron Service"
Start="auto"
Account="LocalSystem"
ErrorControl="normal"
Interactive="no">
</ServiceInstall>
<ServiceControl Id="StartService"
Start="install"
Stop="both"
Remove="uninstall"
Name="CronService"
Wait="yes" />
</Component>
<Component Id="CronServiceDll"
Guid="75C4129B-C28A-45A8-9F06-CB496259FE7F">
<File Id="file_11D016207EA34826A20A52524A3A82BC"
Checksum="yes"
KeyPath="yes"
Source="source-msi\versions\0.10.0\bin\windows\Cronsvclib.dll" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
下面是具体的日志(我正在使用/L*v
选项卸载以获取详细日志)。您可以在中获取完整文件
第2220-2226行
MSI (s) (90:80) [19:11:54:953]: Note: 1: 2205 2: 3: Icon
MSI (s) (90:80) [19:11:54:953]: Note: 1: 2205 2: 3: TypeLib
MSI (s) (90:80) [19:11:54:953]: Note: 1: 2727 2:
MSI (s) (90:80) [19:11:54:973]: RESTART MANAGER: Detected that the service CronService will be stopped due to a service control action authored in the package before the files are updated. So, we will not attempt to stop this service using Restart Manager
MSI (s) (90:80) [19:11:54:973]: Note: 1: 2727 2:
MSI (s) (90:80) [19:11:54:973]: Doing action: InstallInitialize
MSI (s) (90:80) [19:11:54:973]: Note: 1: 2205 2: 3: ActionText
Action ended 19:11:54: InstallValidate. Return value 1.
第4624-4635行
MSI (s) (90:80) [19:11:57:196]: Executing op: ActionStart(Name=StopServices,Description=Stopping services,Template=Service: [1])
MSI (s) (90:80) [19:11:57:196]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (90:80) [19:11:57:196]: Executing op: ServiceControl(,Name=CronService,Action=2,Wait=1,)
MSI (s) (90:80) [19:12:27:239]: Note: 1: 2205 2: 3: Error
MSI (s) (90:80) [19:12:27:239]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1921
MSI (s) (90:80) [19:16:38:940]: Note: 1: 2205 2: 3: Error
MSI (s) (90:80) [19:16:38:940]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (90:80) [19:16:38:940]: Product: Prey Anti-theft -- Error 1921. Service 'Cron Service' (CronService) could not be stopped. Verify that you have sufficient privileges to stop system services.
MSI (s) (90:80) [19:17:08:983]: Note: 1: 2205 2: 3: Error
MSI (s) (90:80) [19:17:08:983]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1921
MSI (c) (48:84) [19:12:27:239]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
考虑到所有这些信息。我推断我必须在某个地方以管理员的身份启动我的MSI。还是不
这就是我的问题:
请注意,所有帮助都将非常有用,我们将不胜感激。错误消息中包含这是权限问题的建议。这种情况很少发生,因为安装服务首先需要提升权限。无法停止服务通常与服务没有足够快地响应停止请求一样简单。CronService是否实现服务接口来响应停止请求?MSI和Windows都不会通过终止服务进程来停止它。Hi Bob。有没有一种方法可以使用burn发出
taskkill
?我尝试使用MSI内部的自定义操作来完成此操作,但是,正如您所知,在InstallInitialize
之前,您不能运行提升权限操作。您可以使用WixUtileExtension中的CloseApplication来终止进程。不幸的是,它没有起作用。但我正在使用另一个MSI来终止这个进程,并使用一个Burn生成的EXE来链接这两个进程。实际上,是你鲍勃给了我这个主意->。我将在这里报告我的成功或失败:)鲍勃。很抱歉打扰你。但是,如何仅为捆绑包创建“添加/删除程序”图标,而不为产品创建?捆绑包似乎有问题。如果我使用my-Bundle.exe并按Uninstall
,我的MSI图标会消失,但不会卸载。这是默认设置:MsiPackage/@Visible=“否”
MSI (s) (90:80) [19:11:57:196]: Executing op: ActionStart(Name=StopServices,Description=Stopping services,Template=Service: [1])
MSI (s) (90:80) [19:11:57:196]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (90:80) [19:11:57:196]: Executing op: ServiceControl(,Name=CronService,Action=2,Wait=1,)
MSI (s) (90:80) [19:12:27:239]: Note: 1: 2205 2: 3: Error
MSI (s) (90:80) [19:12:27:239]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1921
MSI (s) (90:80) [19:16:38:940]: Note: 1: 2205 2: 3: Error
MSI (s) (90:80) [19:16:38:940]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (90:80) [19:16:38:940]: Product: Prey Anti-theft -- Error 1921. Service 'Cron Service' (CronService) could not be stopped. Verify that you have sufficient privileges to stop system services.
MSI (s) (90:80) [19:17:08:983]: Note: 1: 2205 2: 3: Error
MSI (s) (90:80) [19:17:08:983]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1921
MSI (c) (48:84) [19:12:27:239]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg