Monday, June 24, 2013

Wix: how to apply special access rights to a directory

Use <CreateFolder> and <util:PermissionEx> tags.

Don't forget to add "-ext WixUtilExtension" parameter to "candle" and "light" command lines.

User needs to run installer under administrative account.

Example below gives every user generic access to application directory.


<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
 xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
 
    <Product ... />
    
    ...
    
    <Directory Id='AppFolder' Name='My Application'>
        <Component Id='AppFolder' Guid='AC84FDFDA-F8D5-4DEF-8A68-5D8809E818D8'>
            <CreateFolder>
                <util:PermissionEx User="Everyone" GenericAll="yes"/>
            </CreateFolder>
            <File ... />
            <File ... />
            <RemoveFolder Id='AppFolder' On='uninstall' />
        </Component>
    </Directory>

...


No comments:

Post a Comment