Inno Setup - 如何授予一个特定用户对文件夹的权限 [英] Inno Setup - How to give one specific user rights to a folder
问题描述
我想将文件夹权限授予一个特定用户(而不是用户组).我看过多个示例,但它授予整个用户组的权限.
[目录]名称:{应用}";权限: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 icacls
或 cacls
命令来自 [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屋!