mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +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"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -34,7 +35,12 @@ import (
|
|||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
var microsoftDefenderLock = sync.Mutex{}
|
||||
|
||||
func AddMicrosoftDefenderExclusion() (err error) {
|
||||
microsoftDefenderLock.Lock()
|
||||
defer microsoftDefenderLock.Unlock()
|
||||
|
||||
if !gulu.OS.IsWindows() {
|
||||
return
|
||||
}
|
||||
|
|
@ -91,6 +97,9 @@ func AutoProcessMicrosoftDefender() {
|
|||
}
|
||||
|
||||
func checkMicrosoftDefender() {
|
||||
microsoftDefenderLock.Lock()
|
||||
defer microsoftDefenderLock.Unlock()
|
||||
|
||||
if !gulu.OS.IsWindows() || Conf.System.MicrosoftDefenderExcluded {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue