title: How to create a local group and add an active directory user to it in WiX
body: <p>I am trying to create a new local group and then add the currently logged in Active Directory user to that group during an install through WiX.</p>
  
  <p>I have the 2 parts working, but not at the same time... So I can create a group using the <a href="http://dblock.github.com/msiext/" rel="nofollow">Wix UserPrivileges Extension</a> like so:</p>
  
  <pre><code>&lt;Component Id="LocalSQLAdminGroupComponent" Guid="MYGUID" KeyPath="yes"&gt;
              &lt;userPrivileges:LocalGroup Id="LocalSQLAdminsGroupCreate" Name="LocalSQLAdmins" 
                                         Description="Members of this group are designated as sql admins for the ISFS SQL Express instance." 
                                         CheckIfExists="yes" 
                                         CreateOnInstall="yes" 
                                         /&gt;
  </code></pre>
  
  <p>But when I add this to add a user to the group from AD (why I cant use the userPriviledges:User element since it only works for local users), the installer errors because the group hasn't been created before the GroupRef tries to assign the User to the Group.</p>
  
  <pre><code>&lt;util:Group Id="LocalSQLAdminsGroup" Name="LocalSQLAdmins"/&gt;
  ...
  &lt;util:User Id="ADUser" Domain="[%USERDOMAIN]" Name="[%USERNAME]"&gt;
     &lt;util:GroupRef Id="LocalSQLAdminsGroup"/&gt;
  &lt;/util:User&gt;
  </code></pre>
  
  <p>Is there a way that I can ensure that the Group gets created before the GroupRef tries to add it to the group?</p>