为使用 Windows 安装程序创建的自定义文件夹文件添加写入权限 [英] Add write permission to Custom folder files created with windows installer
问题描述
我正在使用 Windows 安装程序在 programdata 文件夹中创建一个文件夹.运行项目我在尝试写入文件时出错
I am creating a folder inside programdata folder using windows installer. Running the project i am getting an error while trying to write to the file
C:\ProgramData\MyAppFolder\settings_file.sqlite
这是错误信息
attempt to write a read-only database.
如何在使用 Windows 安装程序构建 msi 文件时授予 db 文件和其他一些文件的写权限
How can i grant the write permission to the db file and some other files while building the msi file using windows installer
我可以像这样看到文件夹权限
I can see the folder permissions as like this
在通过 Windows 安装程序构建时启用此读写的任何方法
any way to make this read and write enables while building this via windows installer
推荐答案
ACL Permissioning:为普通用户添加写权限通常被认为是一种反模式,但有时出于实用目的,您需要在 PC 的所有用户之间共享文件.
ACL Permissioning: Adding write permissions for regular users is usually considered an anti-pattern, but sometimes you need to share a file among all users of the PC for pragmatic purposes.
写访问:记录:以下是处理权限被拒绝问题的方法列表.列出的大多数选项都不好——这就是为什么要列出这个列表——我们需要记住它们为什么不好以及存在哪些替代方案.
Write Access: For the record: Here is a list of approaches to deal with permission denied issues. Most of the options listed are not good at all - and that is why the list was made - we need to remember why they are bad and what alternatives exist.
部署工具:自定义 ACL 权限的应用 - 在受保护的磁盘位置打开文件以供所有用户写入 - 因您使用的工具而异制作您的 MSI.由于您没有指定 WiX、Installshield、Advanced Installer 或其他内容,我不知道如何回答.让我改用链接:
Deployment Tool: Application of custom ACL permissioning - to open a file in a protected disk location for writing by all users - is different depending on what tool you use to make your MSI. Since you don't specify WiX, Installshield, Advanced Installer or something else I am not sure how to answer. Let me use links instead:
WiX:
- 不同的 WiX 权限元素 - 有两个不同的 PermissionEx 元素 (!)
- PermissionEx (Util Extension - WiX 自己的东西)
- Util 版本:Wix:如何设置文件夹和所有子文件夹的权限
- Different WiX permission elements - there are two different PermissionEx elements (!)
- PermissionEx (Util Extension - WiX's own stuff)
- Util Version: Wix: How to set permissions for folder and all sub folders
- MSI5 版本:如何拒绝使用 wix 安装程序的用户的文件夹权限
- 权限(旧的 MSI LockPermission 表)立>
- FileSharePermission(用于共享权限 - 在您使用需要共享权限)
- Permission (legacy MSI LockPermission table)
- FileSharePermission (for share permissioning - use when you need share permissioning)
安装防护:
高级安装程序:
- 通过右键单击文件夹并转到属性来应用权限:权限对话框.
- 这似乎使用了旧的、遗留的
LockPermission 表
.
还有一些其他工具,如下所述:Short List.次要(更多链接).
There are some other tools as described here: Short List. Secondary (more links).
其他链接:
- 在您的计算机中授予权限的不同方式Windows 安装程序
- 每台机器应用注册
- 在用户文件夹中创建 .config 文件夹
- 桌面应用程序安装后无法打开客户端系统
- http://wixtoolset.org/documentation/manual/v3/xsd/wix/permissionex.html
这篇关于为使用 Windows 安装程序创建的自定义文件夹文件添加写入权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- PermissionEx (Util Extension - WiX's own stuff)
- PermissionEx (Util Extension - WiX 自己的东西)