gpt4 book ai didi

service - 没有足够的权限来安装服务

转载 作者:行者123 更新时间:2023-12-02 06:34:37 25 4
gpt4 key购买 nike

我的服务声明如下:

<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 时,它无法超越“正在启动服务...”。我收到一条错误消息,如下所示:

enter image description here

当我单击“安装”时显示 UAC,那么出了什么问题?

最佳答案

它应该在没有 WiX util 扩展的情况下工作。这是我的完整测试安装程序。创建您自己的测试项目并将我的安装程序复制并粘贴到您的 .wxs 文件中。然后将 File、ServiceInstall 和 ServiceControl 路径和名称替换为您自己的服务。如果您仍然收到相同的错误消息,可能是您实际上没有在计算机上进行安装的权限?

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="TestServiceInstaller" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="d2b63c57-ca50-4f6a-8019-e826cac3d788">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />

<Feature Id="ProductFeature" Title="TestServiceInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="TestServiceInstaller" />
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="TestService.exe" Guid="196BB5E5-F157-4CA2-B740-0A68E1539B7C">
<File Id="TestService.exe" Source="C:\Users\bryan.johnston\Documents\visual studio 2010\Projects\TestService\TestService\bin\Debug\TestService.exe" KeyPath="yes" />
<ServiceInstall Id="TestService.exe" Name="TestService.exe" Account="LocalSystem" Arguments="-start" Start="auto" Interactive="yes" Type="ownProcess" Vital="yes" ErrorControl="critical" />
<ServiceControl Id="TestService.exe" Name="TestService.exe" Stop="both" Start="install" Remove="uninstall" Wait="no" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

关于service - 没有足够的权限来安装服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9588002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com