Wise Package Studio 4.x (and Wise for Windows Installer 4.x) has some features to help you set permissions on files and folders, but they are not what you might call “intuitive” or easy.
To set permissions on individual files, go to the Installation Expert page and the Files item under Feature Details. Browse to the file you want and select it in the list on the right side of the screen, then choose the “Details” button. The second tab is labeled “Permissions,” so that’s obviously where you want to go.
Now, keep in mind that when you set permissions this way you are completely replacing any permissions that file had before-so don’t lock yourself out of it! Make sure you assign specific permissions for the SYSTEM user and local Administrators group, probably giving them all permissions. (Hint: use “BUILTIN” as the domain for local groups, or none at all.) Then assign the local Users group (or whatever your user-permissions group is) with less than full privileges (e.g. select all then un-check “Generic All,” “Change Permissions,” and “Take Ownership”-also un-check the deletion options if you need to as well). Here’s a screenshot:
When you assign permissions to directories/folders, the rights should be inherited by the child files and folders. This is particularly handy for a “user” or “examples” directory that the end users will need complete access to. However, you may have noticed that there’s no way to set the permissions on a directory from the Installation Expert pane! Here’s how to do it: go to the Setup Editor pane and the Components tab. Locate a component which has the target folder as its own path, and right-click on it for the context menu. Choose “Create Folder” from the menu, and you’ll see a dialog with a drop-down list of all the directories the project currently uses. (You may be thinking that this is unnecessary, since Windows Installer will automatically create the folders in the Directory table-but here this is the only way you can assign permissions to it!) Pick the directory you want to create, and click over to the Permissions tab to set the rights in much the same way as you did for the individual files.
Permissions for registry values can be assigned by this GUI method as well, in the Installation Expert pane much like settings for individual files. However, I find this more than a bit confusing as Windows registry permissions are applied at the key level, not for the individual value entries. Supposedly you can assign key permissions in a similar manner to the CreateFolder method, but I’m also a bit weary of that. Thus, if you need to set registry permissions, I’d recommend doing with a tool you know and trust by scripting it as a Custom Action (explained in the next article, Applying Permissions with MSI’s LockPermissions Table).