locked
Writeable folder for All Users RRS feed

  • Question

  • I need some advice on shipping a MS Access database file with my application. The file should be modifiable by All users on that machine.

    I tried to install the db file in CommonAppDataFolder. But it seems even that isn't modifiable by users.

     

    Is there any other location for such files or any VB.NET app configuration that is required OR any configuration which can be made in a VS 2010 Setup project to do set permission automatically during installation ?


    --- Thanks & Regards
    Saturday, June 4, 2011 10:52 AM

Answers

  • All predefined per-machine folders require Administrator privileges. So normal users cannot modify a file CommonAppDataFolder.

    The usual approach is a custom per-machine folder (for example in CommonAppDataFolder) for which you set full permissions for Everyone.

    Windows Installer supports this through LockPermissions table. Visual Studio doesn't support it, so you can either modify the MSI with Orca or use another setup authoring tool which offers access to this table. Here is an article which may help you: http://setupanddeployment.com/installation-environment/set-permissions-installation-folder/

    Another solution is to use a custom action which sets the permissions on your folder. You can try using an external tool like XCACLS.EXE or write your own custom code.


    Cosmin Pirvu
    • Marked as answer by Un-named Monday, June 6, 2011 1:56 PM
    Saturday, June 4, 2011 2:11 PM

All replies

  • All predefined per-machine folders require Administrator privileges. So normal users cannot modify a file CommonAppDataFolder.

    The usual approach is a custom per-machine folder (for example in CommonAppDataFolder) for which you set full permissions for Everyone.

    Windows Installer supports this through LockPermissions table. Visual Studio doesn't support it, so you can either modify the MSI with Orca or use another setup authoring tool which offers access to this table. Here is an article which may help you: http://setupanddeployment.com/installation-environment/set-permissions-installation-folder/

    Another solution is to use a custom action which sets the permissions on your folder. You can try using an external tool like XCACLS.EXE or write your own custom code.


    Cosmin Pirvu
    • Marked as answer by Un-named Monday, June 6, 2011 1:56 PM
    Saturday, June 4, 2011 2:11 PM
  • Thanks I would try using XCACLS utility.

     

    Frankly I now regret using Visual Studio Setup Project. Wish there was a better software to create Installer which could handle dependencies, install .NET Framework (and its dependencies Windows Installer, etc) and set such permissions.


    --- Thanks & Regards
    Monday, June 6, 2011 1:56 PM