Registry permissions
Every key in the Registry has a set of permissions saved to it that affects which users can read or alter 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 the Util extension. So, you'll need to add a reference in your project to WixUtilExtension.dll
, found in the WiX bin
directory, and add the UtilExtension
namespace to your Wix
element. Here's an altered Wix
element:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
Here, we've assigned the Util 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...