Ray*_*Ray 7 windows service installer wix
我正在尝试创建一个wix安装程序来安装和启动NetworkService帐户下的Windows服务,但是失败了,我得到的是"Service"()无法安装.验证您是否具有足够的权限来安装系统服务."
请指教,我的代码如下:
<Component Id="service" Guid='myguid'>
<File Id='JobServiceEXE' Name='JobService.exe' DiskId='1' Source='mypath\JobService.exe' KeyPath='yes' />
<ServiceControl Id="JobService" Name="[SERVICEID]" Stop="uninstall" Remove="uninstall" Wait="yes" />
<ServiceInstall
Id="JobService" Name="[SERVICEID]" DisplayName="[SERVICENAME]" Type="ownProcess" Start="auto" ErrorControl="normal" Vital ='yes'
Account="NT Authority\NetworkService"
Description="Job Service" />
</Component>
Run Code Online (Sandbox Code Playgroud)
谢谢!
首先,您收到的消息可能是由于安全问题造成的。您的安装程序必须由管理员运行,因为创建服务需要管理权限。您可以在元素中检查这一点Condition。
其次,NT Authority\NetworkService在非英语系统上用作帐户名将会失败,因为内置帐户名已本地化。相反,使用NetworkServiceWix 专门识别的普通旧名称并解析为正确的本地化名称。
| 归档时间: |
|
| 查看次数: |
15610 次 |
| 最近记录: |