Book Image

WiX Cookbook

By : Nicholas Matthew Ramirez
1 (1)
Book Image

WiX Cookbook

1 (1)
By: Nicholas Matthew Ramirez

Overview of this book

WiX is a dialect of XML used to make installers for Windows. Its declarative style avoids the complexity and limitations of procedural code, providing you with everything you need to package up an entire application into a single MSI file. This book gives you a good overview of WiX's capabilities to develop your own installer packages with functionalities beyond those available in Windows Installer. In the recipes of this book, you will see ways in which WiX can cut down on your installation time and help you streamline your deployment processes. You will see how to make customized installer UIs, write custom actions, create shortcuts, and also set your application as the default for a file type.
Table of Contents (15 chapters)
14
Index

Adding an existing user to a new group


If you'd like to give an existing user access to your software, you'll need a way to reference their account and then add it to the group you're creating. For example, user Alice already exists on the system and you'd like to add her to a new group called Supervisors. As a side note, you would typically ask for that username through a UI wizard. Then, save the username to a WiX property. Properties can be accessed in other elements by using a square bracket notation, as follows:

<util:User Id="myNewUser" Name="[USERNAME]" />

The UtilExtension namespace doesn't include an element to create a new group. So, we'll return to Community MSI Extensions. In this recipe, we'll locate an existing user account and add it to our Supervisors group.

Getting ready

To prepare for this recipe, create a new setup project and call it AddExistingUserToGroupInstaller.

How to do it...

Use the elements from UserPrivilegesExtension to find an existing user and add it to a...