Skip to content
⌘ NSIS Forum Archive

AccessControl set file with no permission to group

10 posts

aviadlich#

AccessControl set file with no permission to group

I am trying to copy a file to the program files directory/$INSTDIR
Then i want to limit the permissions to the file so the Users group will have no permissions on the file.
this is my code:

SetOutPath $INSTDIR
File "try.txt"
AccessControl:😁isableFileInheritance "$INSTDIR\try.txt"
AccessControl::setOnFile \
"$INSTDIR\try.txt" "(S-1-5-32-545)" ""
I tried various functions, with various parameters but nothing seems to strip the permissions from the Users group

Thanks
aviadlich#
Thanks for the quick reply
BUT it didn't help
This is the line i used:

AccessControl::ClearOnFile \
"$INSTDIR\try.txt" "(S-1-5-32-545)" ""
I also tried this

AccessControl::ClearOnFile \
"$INSTDIR\try.txt" "(S-1-5-32-545)"
Am i getting something completley wrong ?

by the way i am using Vista
but i need to support all platforms
Afrow UK#
Ah sorry if you want to remove them from the ACL, use RevokeOnFile and your last parameter needs to be FullAccess not "". ClearOnFile replaces all ACEs with the given ACE whereas revoke removes the given ACE.

Stu
aviadlich#
I ran the following code

AccessControl:😁isableFileInheritance "$INSTDIR\my-dir"
AccessControl::RevokeOnFile \
"$INSTDIR\my-dir" "(S-1-5-32-545)" "FullAccess"
As you recommended above.
This indeed worked great on Vista and 2003 Server but on XP it doesn't remove the local machine User group

Any ideas out there ?
aviadlich#
Thanks for the reply but i get an empty message box
it looks like the disable inheritance works fine