Inno Setup - 如何授予一个特定用户对文件夹的权限 [英] Inno Setup - How to give one specific user rights to a folder

查看:34
本文介绍了Inno Setup - 如何授予一个特定用户对文件夹的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文件夹权限授予一个特定用户(而不是用户组).我看过多个示例,但它授予整个用户组的权限.

[目录]名称:{应用}";权限:users-full

http://www.jrsoftware.org/ishelp/index.php?topic=dirssection

我试过了,但我收到一个错误

[目录]名称:{应用}";权限:John-full

<块引用>

D:installer.iss 中第 68 行的错误:参数Permissions"包括一个未知的 SID:John"

是否可以将权限授予一个特定用户(硬代码字符串)?

解决方案

我必须说我觉得这很可疑.用户不应具有应用程序安装文件夹的写入权限.如果应用程序需要存储一些数据,它应该将它们写入用户配置文件夹 (C:UsersusernameAppData) 或公共数据文件夹 (C:ProgramData).
另请参阅使用 Inno Setup 安装时应用程序无法运行.


无论如何,Inno Setup 不支持向用户授予权限.我实际上认为,这是因为没有真正好的用例(如上所述).

但是您可以使用 Windows icaclscacls 命令来自 [Run] 部分代替.

[运行]文件名:icacls";参数:"{app}""/授予约翰:w";标志:隐藏

[运行]文件名:cacls";参数:"{app}""/e/g 约翰:w";标志:隐藏

I want to give folder rights to one specific user (not user groups). I have seen multiple examples but it give rights to whole user group.

[Dirs]
Name: "{app}"; Permissions: users-full

http://www.jrsoftware.org/ishelp/index.php?topic=dirssection

I tried this, but I received an error

[Dirs]
Name: "{app}"; Permissions: John-full

Error on line 68 in D:installer.iss: Parameter "Permissions" includes an unknown SID: "John"

Is it possible to give rights to one specific user (hard code string)?

解决方案

I must say that I find this quite suspicious. Users should not have write permissions to application installation folder. If the application needs to store some data, it should write them to a user profile folder (C:UsersusernameAppData) or to a common data folder (C:ProgramData).
See also Application does not work when installed with Inno Setup.


Anyway, Inno Setup does not support granting permissions to a user. I actually assume, it's because there's no real good use case for that (as explained above).

But you can use Windows icacls or cacls commands from [Run] section instead.

[Run]
Filename: "icacls"; Parameters: """{app}"" /grant John:w"; Flags: runhidden

[Run]
Filename: "cacls"; Parameters: """{app}"" /e /g John:w"; Flags: runhidden

这篇关于Inno Setup - 如何授予一个特定用户对文件夹的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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