【问题标题】:Default path of program installed per user on WindowsWindows 上每个用户安装的程序的默认路径
【发布时间】:2020-02-20 22:21:22
【问题描述】:

我正在为 Windows 上的 WPF 应用程序创建 WiX 安装程序。我的目标是允许没有管理员权限的用户安装此程序,但在安装程序中,默认路径当前设置为 Program Files,这会导致访问被拒绝错误。

最佳做法是什么,每个用户安装中的默认安装路径应该是什么? %LOCALAPPDATA%可以吗?

【问题讨论】:

    标签: windows wix windows-installer


    【解决方案1】:

    您所有的ComponentComponentGroup 都属于一个目录

    字典.wxs

          <Directory Id="LocalAppDataFolder">
            <Directory Id="LocalAppDataManufacturerFolder" Name="$(var.Manufacturer)">
              <Directory Id="LocalAppDataProductDatabaseFolder" Name="$(var.ProductName)" />
            </Directory>
          </Directory>
    
          <Directory Id="AppDataFolder">
            <Directory Id="AppDataManufacturerFolder" Name="$(var.Manufacturer)">
              <Directory Id="AppDataProductDatabaseFolder" Name="$(var.ProductName)" />
            </Directory>
          </Directory>
    

    产品.wxs

    <?include .\Dictionary.wxi ?>
    ...
    <ComponentGroup Id="MyCoreComponent" Directory="AppDataProductDatabaseFolder">
    ...
    

    ManufacturerProductname 只是变量,您也可以使用硬编码字符串

    【讨论】:

    • 当你使用WIX_UI UiRef 可以看看&lt;Property Id="WIXUI_INSTALLDIR" Value="AppDataProductDatabaseFolder" /&gt;
    猜你喜欢
    • 1970-01-01
    • 2011-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多