Inno Setup-如何为文件夹赋予一个特定的用户权限 [英] Inno Setup - How to give one specific user rights to a folder
问题描述
我想将文件夹权限授予一个特定用户(而不是用户组).我已经看到了多个示例,但是它赋予了整个用户组权限.
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
D:\ installer.iss上第68行的错误:参数"Permissions"包括未知的SID:"John"
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)?
推荐答案
我必须说我觉得这很可疑.用户不应具有对应用程序安装文件夹的写权限.如果应用程序需要存储一些数据,则应将它们写入用户配置文件文件夹(C:\Users\username\AppData
)或公共数据文件夹(C:\ProgramData
).
另请参见与Inno Setup一起安装时,应用程序无法正常工作.
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:\Users\username\AppData
) or to a common data folder (C:\ProgramData
).
See also Application does not work when installed with Inno Setup.
无论如何,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).
但是您可以使用Windows cacls
或 icacls
命令取而代之的是 [Run]
部分.
But you can use Windows cacls
or icacls
commands from [Run]
section instead.
[Run]
Filename: "cacls"; Parameters: """{app}"" /g John:w"; Flags: runhidden
(未经测试-但应该可以给您带来灵感)
(untested – but it should give you the idea)
这篇关于Inno Setup-如何为文件夹赋予一个特定的用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!