我正在尝试使用WiX创建一个双用途的MSI文件。我已按照WixUI_Advanced的说明以及Single Package Authoring的说明进行操作。当我默认默认安装每个用户(MSIINSTALLPERUSER
= 1)并允许用户选择每台机器安装时,这似乎工作正常。但是,默认情况下将其设置为每台计算机安装(<?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>
为空)始终会导致UAC提示,即使用户选择每用户安装也是如此。每用户安装只将一个文件写入非管理目录,并且绝对不需要提升权限。
我也试过跟随this guide,每个人似乎都在使用WiX进行单一包创作,但结果完全相同。如果每台计算机是默认设置并且每个用户被选中,则会出现UAC提示,但如果每个用户都是默认设置并且每个用户都被选中,则会出现UAC提示。
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 '{}'.
查看安装日志,我看到以下条目:
Sample Point N.conc toc
H1 0.2 0.2
H1 0.3 0.3
H1 0.4 0.4
H1 0.3 0.3
H1 0.3 0.3
H1 0.5 0.5
H1 0.5 0.5
H1 0.4 0.4
H1 0.1 0.1
H2 0.4 0.4
H2 0.5 0.5
H2 0.5 0.6
H2 0.4 0.5
H2 0.1 0.1
H2 0.3 0.3
H2 0.4 0.4
H2 0.3 0.3
H2 0.3 0.3
H3 0.4 0.4
H3 0.5 0.8
H3 0.3 0.3
H3 0.2 0.2
H3 0.2 0.2
H3 0.4 0.4
H3 0.3 0.3
H3 0.2 0.2
H3 0.3 0.4
答案 0 :(得分:3)
根据安装日志,我尝试重新引入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>
似乎 ALLUSERS
和MSIINSTALLPERUSER
都需要根据用户的选择进行设置,以便在每台机器上安装时没有管理员权限install是默认值。然而,我无法在网上找到任何其他地方来确认我的发现。