MSI安装程序文件/文件夹权限 [英] MSI Installer file/folder permissions

查看:356
本文介绍了MSI安装程序文件/文件夹权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用基本的MSI安装程序在programdata文件夹中安装一组文件。由于这些文件的内容是动态的,在安装过程中会生成,因此我在安装过程中使用C#代码创建了这些文件。

这些文件是在适当的文件夹中创建的,除文件权限外,一切都很好。据我所知,文件应该从父文件夹(如果启用)继承他们的权限,但在这种情况下,这不会发生。我创建的文件对于普通用户应该是可写的,我不想为每个创建的文件显式设置权限。问题可能是安装程序以不同的权限运行,因此这些文件不会从父文件夹继承权限?

感谢您提供任何帮助。

安装程序以管理员权限运行,这将允许它在程序文件中更改任何内容。普通用户只能读取程序文件文件夹和ProgramData / Common Application Data文件夹。

MSI的锁定权限表允许安装程序在程序数据/通用应用程序数据中创建后更改文件夹的权限。 Visual Studio的安装项目不支持MSI的锁权限表,所以如果你需要创建的文件夹在安装项目中对普通用户可写,则需要使用SetNamedSecurityInfo授予自定义操作的权限,或者将MSI数据库修改为帖子建立一步。你也可以找到一个MSI创作软件,可以处理MSI的锁定权限表。


I'm trying to install a set of files within the programdata folder using basic MSI installer. As the content of the files are dynamic and generated during the installation process, I'm creating the files in C# code during installation.

The files are created in the appropriate folders, and everything is good, except the files permissions. As I understand, files are supposed to inherit their permissions from the parent folder (if enabled), but in this case, this does not happen. The files I create should be writable for regular users, and i do not wan't to set permissions explicitly for each file created. Could the problem be that the installer runs with different permissions, and therefore the files does not inherit the permissions from their parent folders?

Thanks in advance for any help.

解决方案

the installer runs with administrator access, which would allow it to change anything in program files. A normal user would have read only access to the program files folder and the ProgramData/Common Application Data folder.

MSI's lock permission table allows a setup program to change a folder's permission after creating in ProgramData/Common Application Data. Visual Studio's setup projects does not support MSI's lock permission table, so if you need the folder you created to be writable to normal users in a setup project you need to grant the right in a custom action using SetNamedSecurityInfo or modify the MSI database as a post build step. You can also find a MSI authoring software that can deal with MSI's lock permission table.

这篇关于MSI安装程序文件/文件夹权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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