wix 服务安装权限不足 [英] wix service install not enough permission

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

问题描述

我正在尝试使用 WiX 为窗口服务创建一个安装程序,我尝试了我找到的所有答案,但一无所获.使用 WiX 创建的安装程序仍然无法安装,因为权限不足,权限不足...这是我的代码...

I'm trying to create an installer with WiX for a window service, I tried all the answers that I had found and nothing. The installer created with WiX still won't install because of permission, not enough permission... this is my code...

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'><?define G_TargetDir=$(var.G.TargetDir)?>
    <Product Id="*" Name="G.Installer" Language="1033" Version="1.0.0.0" Manufacturer="" UpgradeCode="PUT-GUID-HERE">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

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

        <Feature Id="ProductFeature" Title="G.Installer" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="G.Installer" />          
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="G.exe" Guid="*">
              <File Id="G.exe" Name="G.exe" Source="$(var.G_TargetDir)G.exe" Vital="yes" KeyPath="yes" />
        <ServiceInstall Id="G.exe" Type="ownProcess" Vital="yes" Name="G.exe" DisplayName="G" Description="Description" Start="auto" Account="LocalSystem" ErrorControl="critical" Arguments="-start" Interactive="yes">
          <util:PermissionEx  User="Everyone" ServicePauseContinue="yes" ServiceQueryStatus="yes" ServiceStart="yes" ServiceStop="yes" ServiceUserDefinedControl="yes" />
        </ServiceInstall>
        <ServiceControl Id="G.exe" Stop="both" Start="install" Remove="uninstall" Name="G.exe" Wait="no"/>
            </Component>
            <Component Id="G.exe.config" Guid="*">
              <File Id="G.exe.config" Name="G.exe.config" Source="$(var.G_TargetDir)G.exe.config" />
            </Component>
            <Component Id="MongoDB.Bson.dll" Guid="*">
              <File Id="MongoDB.Bson.dll" Name="MongoDB.Bson.dll" Source="$(var.G_TargetDir)MongoDB.Bson.dll" />
            </Component>
            <Component Id="System.Buffers.dll" Guid="*">
              <File Id="System.Buffers.dll" Name="System.Buffers.dll" Source="$(var.G_TargetDir)System.Buffers.dll" />
            </Component>
            <Component Id="DnsClient.dll" Guid="*">
              <File Id="DnsClient.dll" Name="DnsClient.dll" Source="$(var.G_TargetDir)DnsClient.dll" />
            </Component>
            <Component Id="System.Runtime.InteropServices.RuntimeInformation.dll" Guid="*">
              <File Id="System.Runtime.InteropServices.RuntimeInformation.dll" Name="System.Runtime.InteropServices.RuntimeInformation.dll" Source="$(var.G_TargetDir)System.Runtime.InteropServices.RuntimeInformation.dll" />
            </Component>
            <Component Id="MongoDB.Driver.Core.dll" Guid="*">
              <File Id="MongoDB.Driver.Core.dll" Name="MongoDB.Driver.Core.dll" Source="$(var.G_TargetDir)MongoDB.Driver.Core.dll" />
            </Component>
            <Component Id="MongoDB.Driver.dll" Guid="*">
              <File Id="MongoDB.Driver.dll" Name="MongoDB.Driver.dll" Source="$(var.G_TargetDir)MongoDB.Driver.dll" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

推荐答案

InstallPrivileges:在尝试其他任何操作之前,请先设置InstallPrivileges 属性 包元素提升"?只是为了确保 - 我认为提升是默认的(至少一旦 InstallScope 是 perMachine?).

InstallPrivileges: Before trying anything else, can you please set the InstallPrivileges attribute of the Package element to "elevated"? Just to make sure - I think elevated is default (once InstallScope is perMachine at least?).

<小时>

编译?:不清楚会发生什么.WiX 项目是否无法编译?看起来很奇怪的第一件事是您没有 制造商 价值 - 也许您在发布之前对其进行了编辑?据我所知,除非 Manufacturer 有值,否则 WiX 3 将拒绝编译.如有遗漏,请补充.


Compiling?: It is not quite clear what happens. Does the WiX project fail to compile? The first thing that looks odd is that you have no Manufacturer value - maybe you redacted it before posting? As far as I know WiX 3 will refuse to compile unless Manufacturer has a value. If it is missing, please add it.

<Product Id="*" Name="G.Installer" Language="1033" Version="1.0.0.0" 
         Manufacturer="YOURCOMPANYNAMEHERE" UpgradeCode="PUT-GUID-HERE">

安装行为:如果安装程序编译通过,运行时是否开始安装,但无法完成?或者它是否完成并且服务无法启动?您是否使用管理员帐户进行安装并在开始安装时收到 UAC 提示?

Setup Behavior: If the setup compiles, does it start to install when run, but fail to complete? Or does it complete and the service fails to start? Are you installing with an administrator account and getting a UAC prompt when you kick off the install?

日志:我们需要更多信息,如果安装程序无法安装,您应该启用 MSI 日志以查看发生了什么.首先检查系统的事件日志,然后运行安装程序,同时启用详细的 MSI 日志记录.我喜欢为所有 MSI 安装启用日志记录.性能受到轻微影响,但当您突然需要一个真实的日志文件时,它总是可用的.您可以按照安装站点上的说明为所有 MSI 文件启用日志记录.org(部分:全局用于机器上的所有设置").安装后,MSI 日志文件将位于您的 %TEMP% 文件夹 中.它们有一个随机的十六进制名称,您可以定期刷新它们,以免它们堆积.您按修改日期/时间排序以查找最新创建的(很明显).一些日志记录和可以在此处找到日志文件解释提示.

Logging: We need some more information what happens, and if the setup fails to install you should enable MSI logging to see what is going on. First you check the system's event logs, and then you run your setup installation whilst enabling verbose MSI logging. I like to enable logging for all MSI installations. Minor performance hit, but a real log-file is always available when you suddenly need one. You can enable logging for all MSI files as explained on installsite.org (section: "Globally for all setups on a machine"). MSI log files will then just sit in your %TEMP% folder after installation. They have a random hex name, and you can flush them all regularly so they don't pile up. You sort by modify date / time to find the latest one(s) created - obviously. Some logging and log-file interpretation hints can be found here.

建议:1:我会尝试设置手动运行服务所需的文件一个虚拟机并将它们注册到验证服务运行没有问题.2:做一个完整的重建 WiX 设置删除任何临时文件和 wixobj文件.您的安装程序可能无法编译,但是它与先前编译中预先存在的 wixobj 文件链接.高度惊讶"因素(链接过时的文件).

Suggestions: 1: I would try to set up the files needed to run the service manually on a virtual machine and register them to verify that the service runs without problems. 2: Do a complete rebuild of the WiX setup deleting any temporary files and wixobj files. It is possible that your installer just does not compile, but that it links with pre-existing wixobj files from a previous compile. A "high astonishment" factor (linking with outdated files).

<小时>

服务启动问题:简单说明一下:如果服务无法启动,请启用其最大日志记录级别并检查事件日志和任何其他日志记录可能有.运行依赖项检查 (Dependencies.exe - 重写 Dependency Walker) 和 检查程序集绑定.检查配置文件中的dev-box sins(硬编码错误值),等等......不需要告诉你这个,但它是我常用的清单(有人因为某种原因投了反对票,让我知道你在那里发现了什么错误吗?我是一名部署专家而不是编码员 - 它更像是一个想法"列表,而不是一个真正的清单).


Service Startup Problems: And just to state the obvious: if the service fails to start, enable its maximal logging level and check the event log and whatever other logging you might have. Run dependency checking (Dependencies.exe - rewrite of Dependency Walker) and check assembly binding. Check for dev-box sins in your config file (hard coded erroneous values), Etc... Don't need to tell you this, but it is my usual checklist (that somebody downvoted for some reason, let me know what errors you find in there maybe? I am a deployment specialist not a coder - it is more of an "ideas" list than a true checklist).

源代码简化:WiX 源文件通常可以按照以下说明进行简化:WIX 中的 guid 语法? 示例:

<Component Id="System.Runtime.InteropServices.RuntimeInformation.dll" Guid="{00000000-0000-0000-0000-000000000000}">
   <File Id="System.Runtime.InteropServices.RuntimeInformation.dll" Name="System.Runtime.InteropServices.RuntimeInformation.dll" Source="$(var.G_TargetDir)System.Runtime.InteropServices.RuntimeInformation.dll" />
 </Component>

对比

<Component>
   <File Source="$(var.G_TargetDir)System.Runtime.InteropServices.RuntimeInformation.dll" />
 </Component>

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

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