为 Visual Studio 安装项目中的自定义文件夹设置权限 [英] Set permissions for a custom folder in a Visual Studio setup project

查看:75
本文介绍了为 Visual Studio 安装项目中的自定义文件夹设置权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要存储所有帐户都可以读/写的程序设置.在安装项目中,我将为 CommonApplicationData 特殊文件夹 (Environment.SpecialFolder.CommonApplicationData) 下的设置创建一个特定于程序的文件夹.默认情况下,此文件夹仅供非管理员帐户读取.

I need to store program settings that can be read/write for all accounts. In the setup project, I will create a program specific folder for the settings under the CommonApplicationData special folder (Environment.SpecialFolder.CommonApplicationData). By default this folder would be read only to non-Administrator accounts.

在 Visual Studio (2013) 安装项目中有没有办法将这个新文件夹的权限更改为所有人的完全控制?我想在设置而不是在程序运行时执行此操作.

Is there a way in the Visual Studio (2013) setup project to change the permissions to this new folder to Full Control for Everyone? I would like to do this in the setup instead of at run-time of the program.

推荐答案

没有改变目录权限的内置方法.这意味着您需要编写自定义操作来执行此操作,因此如果您知道代码是什么,则将其放入自定义操作中.

There is no built-in way to change permissions on a directory. This means that you need to write a custom action to do it, so if you know what the code is then put it in a custom action.

其他 MSI 创建工具支持 MSI 中的 LockPermissions 表(但您需要使用 Orca 并找出所需的值)或扩展自定义操作(如 WiX Util Permissions).

Other MSI creation tools have support for the the LockPermissions table in the MSI (but you'd need to use Orca and figure out the required values), or extension custom actions (like WiX Util Permissions).

这篇关于为 Visual Studio 安装项目中的自定义文件夹设置权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆