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