Article ID: 288975 - Last Review: July 13, 2004 - Revision: 2.1

How To Set Permissions Using the LockPermissions Table

This article was previously published under Q288975
Expand all | Collapse all

SUMMARY

This article describes use of the LockPermissions Table to add or restrict permissions on registry keys, files, or folders.

MORE INFORMATION

The LockPermissions Table can be used to set permissions on objects that are created by your Windows Installer database. You cannot use LockPermissions to modify objects that are not created by your database. The LockPermissions Table's first argument specifies a key from either the File Table, CreateFolders Table, or the Registry Table.

The permissions that can be set are as follows:
Collapse this tableExpand this table
Privilege constantHexadecimalDecimal
GENERIC_ALL0X10000000268435456
GENERIC_WRITE0x400000001073741824
GENERIC_EXECUTE0x20000000536870912
KEY_READ0x00020019131097
FILE_GENERIC_READ0x010200891179785

A common example of using the LockPermissions Table is to set full privileges to a registry key that would normally be locked down. This key might need to contain settings that the user can change, so the user must have full permissions to that key.

Collapse this tableExpand this table
LockObjectTableDomainUserPermission
SampleRegRegistrySampleDomainEveryone268435456

This sample demonstrates giving of full permission to the Everyone group on the SampleReg registry key created in the Registry Table.

You can create permissions for a parent folder or registry key that have lesser permissions than their child keys. You cannot have lesser permissions on a child key than its parents.

Example: A package installs a folder on the root directory called "Parent". The folder permissions are set to read and write. A folder is created in the Parent folder called "Child". This folder may have read, write, or read and write permissions only.

Note: In Windows Installer versions prior to version 2.0, you cannot set permissions on files that are stored in external or internal cabinet files. This problem has been resolved in version 2.0 of the Windows Installer.

For more information on the LockPermissions Table see the Windows Installer SDK documentation.

You can download the Windows Installer SDK from the following Web page:
http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/MSDN-FILES/027/001/457/msdncompositedoc.xml (http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/MSDN-FILES/027/001/457/msdncompositedoc.xml)

APPLIES TO
  • Microsoft Windows Installer 1.1
  • Microsoft Windows Installer 1.2
  • Microsoft Windows Installer 2.0
Keywords: 
kbhowto KB288975
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations