Use Formated properties in UserID

33 views
Skip to first unread message

Ilir Bekteshi

unread,
Feb 9, 2015, 5:22:23 AM2/9/15
to msi...@googlegroups.com
Hi, i'm trying to create a new group and add two existing users to that group but i'm getting some errors on build and it doesn't work

Error 20 ICE03: Invalid identifier; Table: LocalGroupMembers, Column: LocalUserId, Key(s): AddUserToGroup
Error 21 ICE03: Invalid identifier; Table: LocalGroupMembers, Column: LocalUserId, Key(s): AddCurrentUserToGroup

This is the code i'm using

    <Component Id="C_CreateGroup" Guid="guid" KeyPath="yes">
      <UserPrivileges:LocalGroup
        Id="SomeGroup"
        Name="SomeGroup"
        Description="SomeGroup"
        CheckIfExists="yes"
        CreateOnInstall="yes"
        DeleteOnUnInstall="no">

        <UserPrivileges:LocalGroupMember
          Id="AddUserToGroup"
          UserId="[CUSTOMUSER]"
          AddOnInstall="yes"
          RemoveOnUnInstall="no"
          CheckIfMember="no" />

        <UserPrivileges:LocalGroupMember
          Id="AddCurrentUserToGroup"
          UserId="[LogonUser]"
          AddOnInstall="yes"
          RemoveOnUnInstall="no"
          CheckIfMember="no" />
      </UserPrivileges:LocalGroup>
   </Component>

Any suggestions?

Log fragments:
MSI (s) (40!EC) [11:11:32:438]: PROPERTY CHANGE: Adding CreateLocalUsers_Deferred property. Its value is '<LocalUsers/>
MSI (s) (40!EC) [11:11:32:438]: PROPERTY CHANGE: Adding DeleteLocalUsers_Deferred property. Its value is '<LocalUsers/>
PROPERTY CHANGE: Adding CreateLocalGroups_Deferred property. Its value is '<LocalGroups><LocalGroup create="true" delete="false" check="true" id="SomeGroup"><Name>SomeGroup</Name><Description>SomeGroup</Description></LocalGroup></LocalGroups>
MSI (s) (40!10) [11:11:32:719]: PROPERTY CHANGE: Adding DeleteLocalGroups_Deferred property. Its value is '<LocalGroups><LocalGroup create="true" delete="false" check="true" id="SomeGroup"><Name>SomeGroup</Name><Description>SomeGroup</Description></LocalGroup></LocalGroups>
MSI (s) (40!E4) [11:11:32:813]: PROPERTY CHANGE: Adding AddLocalGroupMembers_Deferred property. Its value is '<LocalGroupMembers><LocalGroupMember add="true" remove="false" check="false" id="AddUserToGroup"><Username></Username><Group>SomeGroup</Group></LocalGroupMember><LocalGroupMember add="true" remove="false" check="false" id="AddCurrentUserToGroup"><Username></Username><Group>SomeGroup</Group></LocalGroupMember></LocalGroupMembers>
MSI (s) (40!E4) [11:11:32:813]: PROPERTY CHANGE: Adding RemoveLocalGroupMembers_Deferred property. Its value is '<LocalGroupMembers><LocalGroupMember add="true" remove="false" check="false" id="AddUserToGroup"><Username></Username><Group>SomeGroup</Group></LocalGroupMember><LocalGroupMember add="true" remove="false" check="false" id="AddCurrentUserToGroup"><Username></Username><Group>SomeGroup</Group></LocalGroupMember></LocalGroupMembers>

LocalGroupMembers_Deferred: MSI Extensions 1.4.1114.0
LocalGroupMembers_Deferred: Adding "" to "SomeGroup"
LocalGroupMembers_Deferred: [LocalGroupMembers_Deferred] std::exception: 0x8007056b - Error adding " to group ".\SomeGroup": A member could not be added to or removed from the local group because the member does not exist.
CustomAction AddLocalGroupMembers_Deferred returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 11:11:40: InstallFinalize. Return value 3.

Daniel Doubrovkine

unread,
Feb 9, 2015, 7:06:10 AM2/9/15
to msi...@googlegroups.com
These are deferred custom actions, and you need to have all values ready to go before any deferred CA is executed. It looks like [CUSTOMUSER[ or [LogonUser] aren't set in the immediate CAs. See where/how you set them before this.

--
You received this message because you are subscribed to the Google Groups "msiext" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msiext+un...@googlegroups.com.
To post to this group, send email to msi...@googlegroups.com.
Visit this group at http://groups.google.com/group/msiext.
For more options, visit https://groups.google.com/d/optout.



--

Ilir Bekteshi

unread,
Feb 9, 2015, 7:33:45 AM2/9/15
to msi...@googlegroups.com
Found the problem :) you need to have a "reference" using UserPrivileges:LocalUser for the user before using LocalGroupMember

<UserPrivileges:LocalUser Id="currentLoggedOnUser" Username="[LogonUser]" CreateOnInstall="no" DeleteOnUnInstall="no" CheckIfExists="no" />

Then update LocalGroupMember UserID:

<UserPrivileges:LocalGroupMember
          Id="AddCurrentUserToGroup"
          UserId="currentLoggedOnUser"
          AddOnInstall="yes"
          RemoveOnUnInstall="no"
          CheckIfMember="no" />
Reply all
Reply to author
Forward
0 new messages