在 WiX 中为每用户或每机器安装上下文设置 ALLUSERS [英] Setting ALLUSERS in WiX for per-user or per-machine installation context

查看:18
本文介绍了在 WiX 中为每用户或每机器安装上下文设置 ALLUSERS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 WiX 3.5.我的安装程序应该同时启用每用户和每台机器的安装.我想通过使用单选按钮(每个人"和只有我")来实现这一点.

I use WiX 3.5. My installer should enable both per-user and per-machine installation. I would like to achieve that by using radio buttons ("Everyone" and "Just me").

我在互联网上找到了一些参考资料:

I found a couple of references on the Internet:

如果我理解正确的话,我的安装程序应该将 ALLUSERS 属性设置为 1 以进行每台机器安装,并将 ALLUSERS 属性设置为"(空字符串)以进行每用户安装.

If I understand that correctly my installer should set ALLUSERS property to 1 for per-machine installation and to "" (empty string) for per-user installation.

我的问题是无论我尝试什么,ALLUSERS 总是设置为 1.即使我根本没有设置它!

My problem is no matter what I try ALLUSERS is always set to 1. Even when I don't set it at all!

这是我尝试过的几件事:

Here is a couple of things I tried:

<Control Id="UserSelection"
         Type="RadioButtonGroup"
         X="26"
         Y="115"
         Width="305"
         Height="45"
         Property="ASSISTANCE_USERS"
         Text="ASSISTANCE_USERS">
    <RadioButtonGroup Property="ASSISTANCE_USERS">
        <RadioButton Value="cur"
                     X="0"
                     Y="0"
                     Width="295"
                     Height="16"
                     Text="Just me" />
        <RadioButton Value="all"
                     X="0"
                     Y="20"
                     Width="295"
                     Height="16"
                     Text="Everyone" />
    </RadioButtonGroup>
</Control>

然后根据 ASSISTANCE_USERS 设置 ALLUSERS:

and then setting the ALLUSERS based on ASSISTANCE_USERS:

  <Publish Property="ALLUSERS"
           Value="{}">ASSISTANCE_USERS = "cur"</Publish> <!-- set null value -->
  <Publish Property="ALLUSERS"
           Value="1">ASSISTANCE_USERS = "all"</Publish>

但是,ALLUSERS 始终为 1.

However, ALLUSERS is always 1.

我也尝试将 ALLUSERS 设置为空字符串:

I also tried just setting ALLUSERS to an empty string:

<Property Id="ALLUSERS" Secure="yes"/>

这应该将 ALLUSERS 设置为",但它仍然是1"

This should set ALLUSERS to "", yet it stays "1"

一旦我能够设置 ALLUSERS,我应该能够使用 HKMU 进行每用户和每台机器的安装.

Once I'm able to set ALLUSERS, I should be able to use HKMU for per-user and per-machine installtion.

推荐答案

检查详细日志(使用/l*vx):MSI 记录每个属性更改,以便您可以查看何时设置了 ALLUSERS.

Check a verbose log (using /l*vx): MSI logs every property change so you can see when ALLUSERS is being set.

这篇关于在 WiX 中为每用户或每机器安装上下文设置 ALLUSERS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆