diff --git a/config/tweaks.json b/config/tweaks.json index 12c692c1..10fc9e0b 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -2653,20 +2653,21 @@ ], "InvokeScript": [ " - $RazerPath = \"C:\\Windows\\Installer\\Razer\" - Remove-Item $RazerPath -Recurse -Force - New-Item -Path \"C:\\Windows\\Installer\\\" -Name \"Razer\" -ItemType \"directory\" - $Acl = Get-Acl $RazerPath - $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule(\"NT AUTHORITY\\SYSTEM\",\"Write\",\"ContainerInherit,ObjectInherit\",\"None\",\"Deny\") - $Acl.SetAccessRule($Ar) - Set-Acl $RazerPath $Acl + $RazerPath = \"C:\\Windows\\Installer\\Razer\" + + if (Test-Path $RazerPath) { + Remove-Item $RazerPath\\* -Recurse -Force + } + else { + New-Item -Path $RazerPath -ItemType Directory + } + + icacls $RazerPath /deny \"Everyone:(W)\" " ], "UndoScript": [ " - $RazerPath = \"C:\\Windows\\Installer\\Razer\" - Remove-Item $RazerPath -Recurse -Force - New-Item -Path \"C:\\Windows\\Installer\\\" -Name \"Razer\" -ItemType \"directory\" + icacls \"C:\\Windows\\Installer\\Razer\" /remove:d Everyone " ], "link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/razerblock"