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