您如何在NSIS中设置目录权限? [英] How do you set directory permissions in NSIS?

查看:742
本文介绍了您如何在NSIS中设置目录权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用需要管理员安装的Nullsoft安装系统来构建Windows安装程序.安装程序将创建一个日志"目录.由于普通用户可以运行此应用程序,因此该目录需要普通用户可写.如何指定所有用户应具有使用NSIS脚本语言对该目录进行写访问的权限?

I'm trying to build a Windows installer using Nullsoft Install System that requires installation by an Administrator. The installer makes a "logs" directory. Since regular users can run this application, that directory needs to be writable by regular users. How do I specify that all users should have permission to have write access to that directory in the NSIS script language?

我承认这听起来像是一个坏主意,但是该应用程序只是一个内部应用程序,专用网络上只有少数人使用.我只需要保存日志文件,这样我就可以了解如果发生不良情况,为什么该应用程序已损坏.无法将用户设置为管理员.

I admit that this sounds a like a sort of bad idea, but the application is just an internal app used by only a few people on a private network. I just need the log files saved so that I can see why the app is broken if something bad happens. The users can't be made administrator.

推荐答案

使用 AccessControl 插件然后将其添加到脚本中的"logs"目录位于安装目录中.

Use the AccessControl plugin and then add this to the script, where the "logs" directory is in the install directory.

AccessControl::GrantOnFile "$INSTDIR\logs" "(BU)" "FullAccess"

这将为所有用户提供对该文件夹的完全访问权限.

That gives full access to the folder for all users.

这篇关于您如何在NSIS中设置目录权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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