mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-29 01:22:34 -05:00
Moved razer-block from features to tweaks
This commit is contained in:
@ -48,7 +48,6 @@ function Invoke-WPFButton {
|
||||
"WPFFixesUpdate" {Invoke-WPFFixesUpdate}
|
||||
"WPFFixesWinget" {Invoke-WPFFixesWinget}
|
||||
"WPFRunAdobeCCCleanerTool" {Invoke-WPFRunAdobeCCCleanerTool}
|
||||
"WPFRazerBlock" {Invoke-WPFRazerBlock}
|
||||
"WPFFixesNetwork" {Invoke-WPFFixesNetwork}
|
||||
"WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
|
||||
"WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
|
||||
|
@ -1,22 +0,0 @@
|
||||
function Invoke-WPFRazerBlock {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Blocks razer software automatic install.
|
||||
.DESCRIPTION
|
||||
It disables the automatic driver installation and denies write permission of razer folder to system which prevents the automatic install.
|
||||
#>
|
||||
$RazerPath = "C:\Windows\Installer\Razer"
|
||||
|
||||
# Disable driver auto-install via registry
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Installer" -Name "DisableCoInstallers" -Type DWord -Value 1
|
||||
|
||||
# Remove and lock install directory
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user