为使用 Windows 安装程序创建的自定义文件夹文件添加写入权限 [英] Add write permission to Custom folder files created with windows installer

查看:32
本文介绍了为使用 Windows 安装程序创建的自定义文件夹文件添加写入权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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:

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