【问题标题】:Wix - installing patches without admin rightsWix - 安装没有管理员权限的补丁
【发布时间】:2016-12-01 13:55:56
【问题描述】:

以下是主安装程序的 wxs 文件。这将在创建后使用 Sign.pfx 进行签名。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="48C49ACE-90CF-4161-9C6E-9162115A54DD"
        Name="WiX Patch Example Product"
        Language="1033"
        Version="1.0.0"
        Manufacturer="Dynamo Corporation"
        UpgradeCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">
        <Package Description="Installs a file that will be patched."
            Comments="This Product does not install any executables"
            InstallerVersion="200"
            Compressed="yes" AdminImage="no" />

        <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>


        <FeatureRef Id="SampleProductFeature"/>

        <PatchCertificates>
            <DigitalCertificate Id="MyNewCertificate" SourceFile="Sign.pfx"/>
        </PatchCertificates>

        <PackageCertificates>
            <DigitalCertificate Id="MyNewCertificate" SourceFile="Sign.pfx"/>
        </PackageCertificates>

    </Product>

    <Fragment>
        <Feature Id="SampleProductFeature" Title="Sample Product Feature" Level="1">
            <ComponentRef Id="SampleComponent" />
        </Feature>
    </Fragment>

    <Fragment>
        <DirectoryRef Id="SampleProductFolder">
            <Component Id="SampleComponent" Guid="{C28843DA-EF08-41CC-BA75-D2B99D8A1983}" DiskId="1">
                <File Id="SampleFile" Name="Sample.txt" Source=".\$(var.Version)\Sample.txt" />
            </Component>
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="SampleProductFolder" Name="Patch Sample Directory">
                </Directory>
            </Directory>
        </Directory>
    </Fragment>
</Wix>

以下是需要安装的补丁文件,不需要管理员权限。目前补丁可以正常工作,但需要管理员权限。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Patch 
        AllowRemoval="yes"
        Manufacturer="Dynamo Corp" 
        MoreInfoURL="http://www.dynamocorp.com/"
        DisplayName="Sample Patch" 
        Description="Small Update Patch" 
        Classification="Update"
        >

        <Media Id="5000" Cabinet="RTM.cab">
            <PatchBaseline Id="RTM"/>
        </Media>

        <PatchFamilyRef Id="SamplePatchFamily"/>

    </Patch>

    <Fragment>    
        <PatchFamily Id='SamplePatchFamily' Version='1.2.0.0' Supersede='yes' ProductCode="48C49ACE-90CF-4161-9C6E-9162115A54DD">
            <ComponentRef Id="SampleComponent"/>
        </PatchFamily>
    </Fragment>
</Wix>

示例代码取自官方 wix 教程http://wixtoolset.org/documentation/manual/v3/patching/wix_patching.html

如何才能为所有用户(具有管理员权限)安装应用程序(目前已完成),但非管理员可以安装补丁文件。

我尝试过的:添加了PatchCertificatesPackageCertificates。没有区别。

【问题讨论】:

  • 安装补丁时创建的详细日志文件中是否有任何提示?搜索LUA
  • LUA=0 在主安装程序和补丁程序中。还有一个条目是LUA patching is disabled: missing MsiPatchCertificate table

标签: wix


【解决方案1】:

我能找到的大多数示例都使用 .cer 文件而不是 .pfx 来表示 PatchCertificates/DigitalCertificate/@SourceFile(例如 Question about UAC patching on Vista-patch certificate is not recognized,其中包括 creating a .cer from a .pfx 的备用方向,如果您还没有的话,利用 @987654324 @.) 您可能需要指定一个 .cer 文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-24
    • 2016-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多