An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Support one-click addition of Microsoft Defender exclusions https://github.com/siyuan-note/siyuan/issues/13650
Daniel311b9e7b3dbf
diff --git a/kernel/model/elevator_windows.go b/kernel/model/elevator_windows.goindex 9f18492f42..41bb969f45 100644--- a/kernel/model/elevator_windows.go+++ b/kernel/model/elevator_windows.go@@ -52,15 +52,17 @@ func AddMicrosoftDefenderExclusion() (err error) {installPath := filepath.Dir(util.WorkingDir)psArgs := []string{"-Command", "Add-MpPreference", "-ExclusionPath", installPath, ",", util.WorkspaceDir}if isAdmin() {+ logging.LogInfof("current user is admin, add Windows Defender exclusion path [%s, %s]", installPath, util.WorkingDir)cmd := exec.Command("powershell", psArgs...)gulu.CmdAttr(cmd)output, cmdErr := cmd.CombinedOutput()if nil != cmdErr {- logging.LogErrorf("add Windows Defender exclusion path [%s] failed: %s, %s", installPath, cmdErr, string(output))+ logging.LogErrorf("add Windows Defender exclusion path [%s, %s] failed: %s, %s", installPath, util.WorkingDir, cmdErr, string(output))err = cmdErrreturn}} else {+ logging.LogInfof("current user is not admin, use elevator to add Windows Defender exclusion path [%s, %s]", installPath, util.WorkingDir)elevator := filepath.Join(util.WorkingDir, "elevator.exe")if "dev" == util.Mode || !gulu.File.IsExist(elevator) {elevator = filepath.Join(util.WorkingDir, "elevator", "elevator-"+runtime.GOARCH+".exe")@@ -81,12 +83,13 @@ func AddMicrosoftDefenderExclusion() (err error) {argPtr, _ := syscall.UTF16PtrFromString(strings.Join(ps, " "))execErr := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, 1)if execErr != nil {- logging.LogErrorf("add Windows Defender exclusion path [%s] failed: %s", installPath, execErr)+ logging.LogErrorf("add Windows Defender exclusion path [%s, %s] failed: %s", installPath, util.WorkingDir, execErr)err = execErrreturn}}+ logging.LogInfof("added Windows Defender exclusion path [%s, %s]", installPath, util.WorkingDir)util.PushMsg(Conf.language(102), 5000)return}