mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Support one-click addition of Microsoft Defender exclusions https://github.com/siyuan-note/siyuan/issues/13650
This commit is contained in:
parent
b3f55ac3b4
commit
203dbfa35a
1 changed files with 9 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
|
|
@ -34,7 +35,12 @@ import (
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var microsoftDefenderLock = sync.Mutex{}
|
||||||
|
|
||||||
func AddMicrosoftDefenderExclusion() (err error) {
|
func AddMicrosoftDefenderExclusion() (err error) {
|
||||||
|
microsoftDefenderLock.Lock()
|
||||||
|
defer microsoftDefenderLock.Unlock()
|
||||||
|
|
||||||
if !gulu.OS.IsWindows() {
|
if !gulu.OS.IsWindows() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -91,6 +97,9 @@ func AutoProcessMicrosoftDefender() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkMicrosoftDefender() {
|
func checkMicrosoftDefender() {
|
||||||
|
microsoftDefenderLock.Lock()
|
||||||
|
defer microsoftDefenderLock.Unlock()
|
||||||
|
|
||||||
if !gulu.OS.IsWindows() || Conf.System.MicrosoftDefenderExcluded {
|
if !gulu.OS.IsWindows() || Conf.System.MicrosoftDefenderExcluded {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue