如何使用在自定义操作中设置的属性?

发布于 2024-10-03 02:26:04 字数 1089 浏览 0 评论 0原文

我想在自定义操作中设置一个属性,然后在标准自定义操作“util:User”中使用它。但无论我将该属性放在 wxs 文件中的哪个位置,我总是收到“错误 LGHT0094:未解析的符号引用”

详细信息: 在我的设置中,我想使用 util:User 添加新用户。应使用 util:GroupRef 将用户添加到“Power Users”组。到目前为止没有问题。不幸的是,组名称取决于语言。在德语中,“高级用户”是“Hauptbenutzer”。因此,我想在自定义操作中查找众所周知的 SID S-1-5-32-547,通过调用 MsiSetProperty 在此自定义操作中设置一个属性,然后将该属性用于 util:GroupRef。

据我了解,该属性必须在 wxs 文件中的某个位置声明。 在我发现的示例中,该属性从未声明如下(但我也尝试过):

<Property Id="TextSID" Value="Power Users" />

在示例中总是有一个自定义操作来设置属性,例如:

<CustomAction Id="SetTextSID"
  Property="TextSID"
  Value="Power Users"
  Return="check" />

我的问题是,用户的创建失败“编译”,因为属性“TextSID”未知:

  <Component Id="CreateUser" Guid="Some GUID here in my original wxs file">
    <util:User Id="UserUser" 
               Name="User" Password="Password"
               CanNotChangePassword="yes" PasswordNeverExpires="yes">
      <util:GroupRef Id="TextSID" />
    </util:User>
  </Component>

我以前从未做过自定义操作,而且我是 WiX 和 MSI 的新手,所以任何想法都会非常受欢迎。

问候 拉尔夫

I want to set a property in a custom action and use it in the standard custom action "util:User" afterwards. But no matter where I put the property in my wxs-file, I always get "error LGHT0094 : Unresolved reference to symbol"

Details:
In my setup I want to add a new user by using util:User. The user should be added to the group "Power Users" by using util:GroupRef. No Problem so far. Unfortunately the group names are language dependent. In german "Power Users" is "Hauptbenutzer". So I want to look up the well known SID S-1-5-32-547 in a custom action, set a property in this custom action by calling MsiSetProperty and then use the property for util:GroupRef.

As far as I understand, the property must be declared somewhere in the wxs-file.
In the examples I found, the property was never declared as follows (but I also tried that):

<Property Id="TextSID" Value="Power Users" />

In the examples there always was a custom action to set the property, like:

<CustomAction Id="SetTextSID"
  Property="TextSID"
  Value="Power Users"
  Return="check" />

My problem is, that the creation of the user fails to "compile" because the property "TextSID" is not known:

  <Component Id="CreateUser" Guid="Some GUID here in my original wxs file">
    <util:User Id="UserUser" 
               Name="User" Password="Password"
               CanNotChangePassword="yes" PasswordNeverExpires="yes">
      <util:GroupRef Id="TextSID" />
    </util:User>
  </Component>

I have never done a custom action before and I'm a new to WiX and MSI, so any idea would be very welcome.

Regards
Ralf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绅刃 2024-10-10 02:26:04

抱歉浪费了您的时间。

在发布这个问题之前,我盯着 XML 看了几个小时,只是为了在发布后立即找到答案:-(

我唯一的问题是,不可能引用不存在的东西。在这种情况下,“ util:Group”丢失。

Sorry for wasting your time.

I stared at my XML for hours before I posted this question, just to find the answer immediately after my post :-(

My only problem was, that it is not possible to reference to something that isn't there. In this case the "util:Group" was missing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文