How to give Read/Write permissions to a Folder during installation using .NET

后端 未结 9 1546
不思量自难忘°
不思量自难忘° 2020-11-27 14:33

I have a Setup project that I have build using Visual Studio 2010.

The installer works fine in terms of installing the application and all its dependencies into thei

9条回答
  •  温柔的废话
    2020-11-27 15:12

    By default Users group doesn't have write access in per-machine locations like Program Files. This is a Windows standard which is not related to installations. However, during install you can set any permissions you want.

    Windows Installer does support custom permissions, but Visual Studio doesn't offer a way for setting them. So the only solution in Visual Studio is a custom action.

    Unfortunately Visual Studio doesn't support attached custom actions. So using XCACLS.EXE to set permissions would work only if you include it in your package (it will be installed on the target machine along with your files).

    A cleaner, but more complex solution is to write a custom action yourself (using custom code) to set the permissions you want.

    The fastest and cleanest solution would be to use a different setup authoring tool which offers more control over permissions.

提交回复
热议问题