views:

414

answers:

2

I need to add group within a group e.g. COMPUTER\Users group to the "Backup Operators" group.

Wix provides a way to add a user to a group using the GroupRef Element but does not seem to provide an obvious way to add a group

Can this be done? If so how?

+1  A: 

You'd need to write a CustomAction. It probably wouldn't take too much to extend the existing User and Group CustomAction in the WiX toolset to support this. In fact, there is a feature request open for this behavior in the WiX toolset today. Maybe you could contribute the fix?

Rob Mensching
Being new to WIX I am not sure if I can do this but I will give it a go.
Menuta
A: 

Some resources:

http://msdn.microsoft.com/en-us/library/aa370283(VS.85).aspx (Local Group Functions) http://support.microsoft.com/kb/119671

I got some C++ code that wraps user and group creation like this:

LocalGroup* group = new LocalGroup( "TestGroup", "TestGroupComment" );
LocalUser* user =  new LocalUser( "TestUser", "Pa$$word!", "TestComment" );
group->AddUser( user  );
user->Create();
group->Create();
group->AddUser( user );

I can forward you this code if it may be of any use, but there is currently no support for adding groups to groups (should be trivial to add though).

Glytzhkof