NSIS AccessControl Plugin disable access to directory for all except Admins and System

StackOverflow https://stackoverflow.com/questions/22415426

  •  15-06-2023
  •  | 
  •  

문제

I just read bunch of answers about setting permissions to directory by NSIS AccessControl plugin, but all those only show basic usage copy pasted from plugin site... It only shows cases ALL or NOTHING... but how do I disable ALL permissions to directory for everyone except System and Administrators?

도움이 되었습니까?

해결책

AccessControl::DisableFileInheritance "$temp\test.tmp"
Pop $0
DetailPrint $0

AccessControl::ClearOnFile "$temp\test.tmp" "(S-1-5-18)" "FullAccess"
Pop $0
DetailPrint $0

AccessControl::SetOnFile "$temp\test.tmp" "(S-1-5-32-544)" "FullAccess"
Pop $0
DetailPrint $0

This might not be enough, you should probably also use SetFileOwner and maybe SetFileGroup...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top