没有足够的权限来安装服务 [英] Not enough permissions to install service

查看:39
本文介绍了没有足够的权限来安装服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下服务声明:

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

This compiles and links without any errors or warnings. The service exe is properly specified using KeyPath="yes". When I run my msi, it can't get beyond at 'Starting Service...'. I get an error message, as follows:

当我点击安装"时会显示 UAC,所以出了什么问题?

The UAC is shown when I click 'Install', so what's going wrong?

推荐答案

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

It should work without the WiX util extension. Here is my complete test installer. Create your own test project and copy and past my installer into your .wxs file. Then replace the File, ServiceInstall and ServiceControl paths and names with your own service. If you still get the same error message, could it be that you don't actually have the privileges to do the install on your machine?

<?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>

这篇关于没有足够的权限来安装服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆