Wix-在没有管理权限的情况下安装补丁



下面是主安装程序的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。没什么区别。

我能找到的大多数示例都使用.cer文件,而不是PatchCertificates/DigitalCertificate/@SourceFile的.pfx(例如,关于Vista补丁证书上的UAC补丁的问题无法识别,其中包括从.pfx创建.cer的其他方向(如果您还没有,请利用MsiGetFileSignatureInformation)。您可能需要指定.cer文件。

最新更新