How do I grant full access (read/write/delete) to a directory1 and all its sub-directories for all users using the NSIS language? I have seen this and all similar answers. They all recommend doing this:
AccessControl::GrantOnFile "$APPDATA\${APP_NAME}" "(S-1-5-32-545)" "FullAccess"
I did it, but files created in "$APPDATA\${APP_NAME}"
are still not accessible (can't be read/modified/deleted) for users other than the creator. None of the files can be modified, and some can't even be read. I am on Windows 7 64 bit. What am I doing wrong? I've also tried using "(BU)"
instead of "(S-1-5-32-545)"
and "GenericRead + GenericWrite"
instead of "FullAccess"
. Neither helped.
I am using SetShellVarContext all
and after executing the installer, the permissions look like this:
My main goal is to store files that have to be read and modified by all users. If there is a better way of doing that, other than storing in "C:/ProgramData/MyApplication/"
and giving all users permissions, that will also be useful.
1The directory is "$APPDATA\${APP_NAME}"
, which is C:/ProgramData/MyApplication/