Registry permissions
Every key in the registry has a set of permissions saved to it that affects which users can read or write to it. You can see this in the Registry Editor by going to Run | regedit, right-clicking on a key, and selecting Permissions. WiX allows you to change these permissions with its PermissionEx
element.
PermissionEx
isn't in the default WiX namespace, but rather in WixUtilExtension
. So, you'll need to add a reference in your project to WixUtilExtension
, found in the WiX bin
directory, and add the UtilExtension
namespace to your Wix
element. Here's the updated Wix
element:
<Wixxmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
We've assigned the UtilExtension
namespace to the prefix util
. Now, when we create a registry key with a RegistryKey
element, we'll nest a PermissionEx
element inside it to set its permissions. The next example sets the permissions of a key called MyKey
so that a user named nickramirez...