Old 19th June 2013, 14:25   #1
Junior Member
Join Date: Jun 2013
Posts: 2
AccessControl: inheritance of permissions

Dear NSIS users, during my installation to the root directory I need to create several folders, copu files there and set full access to all child objects (subdirectories, folders, files and so on) of the root folder. I supposed "AccessControl plugin" could help me and decided to solve this task next way. I set "full access to the root directory" calling "AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"". Then try to inherit properties implementing "AccessControl::EnableFileInheritance "$INSTDIR"". As result I saw that the root directory and new file objects had "full access" but ones that had existed before the installation had no changes in their permission. My OS Win 7 x 64. Of course I can do it manually but I would like installation process does it. Will be glad to see your opinions. Dmitriy.
Sazonov is offline   Reply With Quote
Old 19th June 2013, 18:41   #2
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
Wow! That sounds really unsafe. Do your users know that you are (trying to) enable full write and delete access to everything on their drive? Any passing malware could find an easy home there.
demiller9 is offline   Reply With Quote
Old 19th June 2013, 19:40   #3
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,504
demiller9 is correct, you are not supposed to allow everyone to write to files in $programfiles. If you need write access to some kind of base/template files you should copy them from the shared location into appdata/localappdata when your application runs for the first time.

A middle ground is using all users appdata for these files but you really should think about what happens when different users on the same machine runs your app (and even multiple users running it at the same time)...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th June 2013, 20:51   #4
Junior Member
Join Date: Jun 2013
Posts: 2
Ok. For exmple, I have the next "C:\MyCompanyName\RootFolder". All installation is realised in "RootFolder" and I want make full accses to all childs objects of only "RootFolder", not for "C:\ProgramFiles" or even for "C:\MyCompanyName". I know it is not safe way, but now it is the only way to avoid a software modification.
Sazonov is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

accesscontrol inheritance

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump