You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following fragment that is expected to create new local account and add it to local Administrators group, regardless the group name (such as on non-English systems)
Fragment compiles successflly, but upon execution, it fails with 0x80004002 "Cannot add user to group BUILTIN\Administrators"
Note: In case that group name is different, such as on localized Windows, group name changes appropriately, so group name resolution is OK.
Problem is most likely caused by BUILTIN prefix in group name - if removed from group name, everything works as expected
Can the behavior can be fixed so as the logic could work? One easy option could be to introduce new variable, such as WIX_ACCOUNT_ADMINISTRATORS_NAME, that would contain group name without BUILTIN prefix
Thanks,
Jiri
Originally opened by jiri.formacek
The text was updated successfully, but these errors were encountered:
FYI - what I do in my mba is:
string aSID = new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null).ToString();
string domain_adminsGroupName = new System.Security.Principal.SecurityIdentifier(aSID).Translate(typeof(System.Security.Principal.NTAccount)).ToString();
this._adminsGroupName = domain_adminsGroupName.Split('').Last();
Then I pass AdminsGroupName down as a remembered property to:
<util:Group Id="AdminsGroup" Name="[ADMINSGROUPNAME]"/>
FYI - Also the code I posted supports multiple languages, particularly German, which is where I had issues before implementing this code about a year ago, shipping in many bundles.
Consider the following fragment that is expected to create new local account and add it to local Administrators group, regardless the group name (such as on non-English systems)
<util:Group Id="AdminsGroup" Name="[WIX_ACCOUNT_ADMINISTRATORS]"/>
...
<util:User Id="CustomAdmin" CreateUser="yes" FailIfExists="no" Name="[CUSTOMADMINNAME]" Password="[INITIALPASSWORD]" PasswordNeverExpires="yes" CanNotChangePassword="yes" RemoveOnUninstall="yes">
<util:GroupRef Id="AdminsGroup"/>
/util:User
Fragment compiles successflly, but upon execution, it fails with 0x80004002 "Cannot add user to group BUILTIN\Administrators"
Note: In case that group name is different, such as on localized Windows, group name changes appropriately, so group name resolution is OK.
Problem is most likely caused by BUILTIN prefix in group name - if removed from group name, everything works as expected
Can the behavior can be fixed so as the logic could work? One easy option could be to introduce new variable, such as WIX_ACCOUNT_ADMINISTRATORS_NAME, that would contain group name without BUILTIN prefix
Thanks,
Jiri
The text was updated successfully, but these errors were encountered: