【问题标题】:Why does per-user installation of an MSI built with WixUI_Advanced require elevated privileges?为什么每个用户安装使用 WixUI_Advanced 构建的 MSI 需要提升权限?
【发布时间】:2014-12-27 08:09:30
【问题描述】:

我正在使用 WiX 3.8,我想让用户选择按用户或按机器安装软件包。根据the docs,我有以下测试.wxs 文件:

<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>

    <Product Name='Test' Id='D96B1E41-D392-4841-A526-D9BD50824163' UpgradeCode='FBCC53EC-6365-4D63-A584-F39F9984588B'
        Language='1033' Codepage='1252' Version='1.0' Manufacturer='Test Manufacterer'>

        <Package Id='*' Keywords='Installer'
            Description="Test Installer" InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

        <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
        <Property Id='DiskPrompt' Value="Test Installation [1]" />

        <Property Id="ApplicationFolderName" Value="Test" />
        <Property Id="WixAppFolder" Value="WixPerUserFolder" />

        <Directory Id='TARGETDIR' Name='SourceDir'>
            <Directory Id='ProgramFilesFolder' Name='PFiles'>
                <Directory Id='APPLICATIONFOLDER' Name='Test'>
                    <Component Id='Test' Guid='3A810A32-0514-4616-993C-B5BBACB74FC6'>
                        <File Id='TestFile' Name='test.txt' DiskId='1' Source='test.txt' KeyPath='yes' />
                    </Component>
                </Directory>
            </Directory>
        </Directory>

        <Feature Id='Complete' Title='Main Program' Description='The main program.'
            Display='collapse' Level='1' ConfigurableDirectory='APPLICATIONFOLDER'>
            <ComponentRef Id='Test' />
        </Feature>

        <UIRef Id="WixUI_Advanced" />
    </Product>
</Wix>

我正在使用以下命令行构建 MSI:

candle test.wxs && light -ext WixUIExtension test.wixobj

这运行良好并且成功,没有任何错误或警告,但是当我以受限用户身份运行 MSI 并选择“仅为你安装”选项时,当我单击安装时,仍会提示我输入超级用户的凭据.如果我提供了正确的凭据,程序将按预期安装在用户的 AppData 文件夹中。为什么会提示我进行权限提升?有没有办法改变这种行为?

【问题讨论】:

  • 你最终解决了这个问题吗?我在这里也有同样的情况……不想以多个 msi 告终。
  • 我不记得找到解决方案了,抱歉。

标签: wix installation windows-installer elevated-privileges


【解决方案1】:

您需要将 Package InstallPrivilege 设置为 Limited 以告知 Windows MSI 可由受限用户安装。因此,您将看不到 UAC 提示,并且如果受限用户尝试执行违反安全性的操作,安装将失败。

【讨论】:

  • 嗯,这并不像我想要的那样工作:添加有限的 InstallPrivileges 属性会强制我为每个用户安装包,而不是让我选择安装每个用户或每个机器。
猜你喜欢
  • 2013-05-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-26
  • 2014-02-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多