开发者

How to use a property that was set in a custom action?

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜