Search code examples
c#visual-studiovisual-studio-2015windows-installerinstallshield

InstallShield - Set Directory Permissions To ALL Users


I'm using Install Shield 2015 Limited Edition in Visual Studio 2015.

I'm trying to set the permissions of the directory my application installs to, to allow all users: read & execute, list folder contents, read, write access.

I can't find where to do this using the Project Assistant.

I've looked into the .ISL and I can see

<col key="yes" def="s72">Directory</col>
<col def="S72">Directory_Parent</col>
<col def="l255">DefaultDir</col>
<col def="S255">ISDescription</col>
<col def="I4">ISAttributes</col>
<col def="S255">ISFolderName</col>

I'm assuming it's the I4 attribute, but not sure what value to set for it.

Maybe I'm looking too much into this and there is a simpler way.

Thanks!


Solution

  • The Attributes refers to the standard file system attributes (read-only, hidden, etc.) What you're looking for is the Permissions settings.

    I'm not familiar with the LE edition so I don't know if it can be done using the graphical interface (in InstallShield full edition it can be done like this)

    But you can always do the following: locate the ISLockPermissions table in your project file and add a row for your folder like this (YOURFOLDER refers to the folder entry in the 'Directory' table):

        <table name="ISLockPermissions">
        <col key="yes" def="s72">LockObject</col>
        <col key="yes" def="s32">Table</col>
        <col key="yes" def="S255">Domain</col>
        <col key="yes" def="s255">User</col>
        <col def="I4">Permission</col>
        <col def="I4">Attributes</col>
        <row><td>YOURFOLDER</td><td>CreateFolder</td><td>[%USERDOMAIN]</td><td>Users</td><td>131519</td><td>0</td></row>
    </table>
    

    131519 is the combined permission you asked for.

    Edit: If it doesn't work with LE, another approach can be adding a custom action that sets the permission using the icacls command.