gpt4 book ai didi

wix - 如果默认情况下双用途包是每台机器,则每用户安装始终需要管理员权限

转载 作者:行者123 更新时间:2023-12-01 13:48:26 24 4
gpt4 key购买 nike

我正在尝试使用 WiX 创建一个双重用途的 MSI 文件。我已按照 WixUI_Advanced 的说明进行操作以及 Single Package Authoring 的说明.当我默认为每个用户默认安装 (MSIINSTALLPERUSER = 1) 并允许用户选择每台机器安装时,这似乎工作正常。但是,默认情况下将其设置为按计算机安装(MSIINSTALLPERUSER 为空)始终会导致 UAC 提示,即使用户选择按用户安装也是如此。每个用户安装仅将单个文件写入非管理目录,绝对不需要提升权限。

我也试过关注 this guide每个人似乎都在使用 WiX 进行单一包创作,但结果完全相同。如果每台机器是默认设置并且选择了每用户,则会出现 UAC 提示,但如果每用户是默认设置并且选择了每用户,则不会出现 UAC 提示。

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="DE75C3B3-6398-4F25-9048-FB7EEE5F6EBF" Name="MyApp" Language="1033" Version="1.0.0" Manufacturer="Company" UpgradeCode="ED573078-CC3E-4299-9E04-043B1EDC08DB">
<Package InstallerVersion="500" Compressed="yes" />
<!--Single Package Authoring-->
<Property Id="MSIINSTALLPERUSER" Secure="yes" Value="{}"/>
<Property Id="ALLUSERS" Secure="yes" Value="2"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" CabinetTemplate="arc{0}" CompressionLevel="high"/>
<Feature Id="ProductFeature" Title="MyApp" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<UI>
<UIRef Id="WixUI_Advanced" />
</UI>
<Property Id="ApplicationFolderName" Value="MyApp" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />

</Product>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder" Name="PFiles">
<Directory Id="APPLICATIONFOLDER" Name="MyApp">
</Directory>
</Directory>
</Directory>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponents" Directory="APPLICATIONFOLDER">
<Component Id="MyApp.exe" Guid="903EDAFD-F513-407D-85A0-D737013B9B57">
<File Id="MyApp.exe" Source="MyApp.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>

查看安装日志,我看到以下条目:

Product not registered: beginning first-time install
PROPERTY CHANGE: Modifying ALLUSERS property. Its current value is '2'. Its new value: '1'.
PROPERTY CHANGE: Deleting MSIINSTALLPERUSER property. Its current value is '{}'.
...
Action: InstallScopeDlg. Dialog created
PROPERTY CHANGE: Modifying WixAppFolder property. Its current value is 'WixPerMachineFolder'. Its new value: 'WixPerUserFolder'.
PROPERTY CHANGE: Deleting ALLUSERS property. Its current value is '1'.
...
Product not registered: beginning first-time install
PROPERTY CHANGE: Deleting ALLUSERS property. Its current value is '2'.
PROPERTY CHANGE: Deleting MSIINSTALLPERUSER property. Its current value is '{}'.

最佳答案

根据安装日志,我尝试重新引入在 this guide 的修改后的 WixUI 文件中替换的行它更新了 ALLUSERS 属性,因为它似乎被设置为每个用户安装的值 1,这将解释 UAC 提示。俄罗斯博客和原始 WixUI_Advanced 中的以下两行似乎都有效。

<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="{}" Order="2">
WixAppFolder = "WixPerUserFolder"
</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="1" Order="3">
WixAppFolder = "WixPerMachineFolder"
</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="1" Order="3">
WixAppFolder = "WixPerUserFolder"
</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="{}" Order="2">
WixAppFolder = "WixPerMachineFolder"
</Publish>

似乎两者 ALLUSERSMSIINSTALLPERUSER 都需要根据用户的选择进行设置,以允许在没有管理员权限的情况下进行安装每台机器安装是默认设置。然而,我无法在网上找到任何其他地方来证实我的发现。

关于wix - 如果默认情况下双用途包是每台机器,则每用户安装始终需要管理员权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33896015/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com