Adding a new user to an existing group

After creating a new user, you may want to add them to a group that already exists on the computer. For example, members of the Users group can do basic things such as run applications and access local and network printers. Adding your user to this group is a quick way to give them this limited access. It's pretty simple to do this using the UtilExtension namespace, as we'll see.

Getting ready

To prepare for this recipe, add a new setup project and name it NewUserExistingGroupInstaller.

How to do it...

After referencing an existing group with the Group element, add a user to it with the GroupRef element, as shown in the following steps:

  1. Add UtilExtension to the project by right-clicking on the References node ...

Get WiX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.