【发布时间】:2012-03-06 16:40:50
【问题描述】:
我的服务声明如下:
<ServiceControl Id="ServiceStartStop"
Name="[name]"
Start="install"
Stop="both"
Remove="both"
Wait="no"/>
<ServiceInstall Id="ServiceRegister"
Name="[name]"
DisplayName="[displayname]"
Description="[description]"
Account="LocalSystem"
Arguments="-start"
ErrorControl="critical"
Interactive="yes"
Start="auto"
Type="ownProcess"
Vital="yes" >
<util:PermissionEx User="Authenticated Users"
ServiceChangeConfig = "yes"
ServiceEnumerateDependents = "yes"
ServiceInterrogate = "yes"
ServicePauseContinue = "yes"
ServiceQueryConfig = "yes"
ServiceQueryStatus = "yes"
ServiceStart = "yes"
ServiceStop = "yes"
ServiceUserDefinedControl = "yes" />
</ServiceInstall>
这编译和链接没有任何错误或警告。使用KeyPath="yes" 正确指定服务exe。当我运行我的 msi 时,它无法超越“正在启动服务...”。我收到一条错误消息,如下所示:
当我点击“安装”时会显示 UAC,这是怎么回事?
【问题讨论】:
-
您的安装程序是否需要提升权限?
-
@KMoraz 是的,服务需要以提升的权限运行。
-
你设置
<Package InstallPrivileges="elevated" />了吗? -
@KMoraz 我没有,但这似乎没有帮助,我仍然得到相同的错误对话框
标签: service wix windows-installer