Inno Setup - How to give one specific user rights to a folder

爷,独闯天下 提交于 2019-12-22 01:41:15

问题


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)?


回答1:


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.


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 cacls command from [Run] section instead.

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

(untested – but it should give you the idea)



来源:https://stackoverflow.com/questions/54147843/inno-setup-how-to-give-one-specific-user-rights-to-a-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!