{"record":{"id":"88e48bdda1e1c076","repo":"siyuan-note/siyuan","slug":"not-found-elevator-s","errorCode":null,"errorMessage":"not found elevator [%s]","messagePattern":"not found elevator \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/elevator_windows.go","lineNumber":65,"sourceCode":"\t}\n\n\tif !isUsingMicrosoftDefender() {\n\t\treturn\n\t}\n\n\televator := getElevatorBin()\n\tif !gulu.File.IsExist(elevator) {\n\t\tlogging.LogWarnf(\"not found elevator [%s]\", elevator)\n\t\treturn\n\t}\n\n\tinstallPath := filepath.Dir(util.WorkingDir)\n\tlogging.LogInfof(\"use elevator to add Windows Defender exclusion path [%s, %s]\", installPath, util.WorkspaceDir)\n\n\tif !gulu.File.IsExist(elevator) {\n\t\tmsg := fmt.Sprintf(\"not found elevator [%s]\", elevator)\n\t\tlogging.LogWarn(msg)\n\t\terr = errors.New(msg)\n\t\treturn\n\t}\n\n\t// 工作空间路径由用户自由指定，这里校验并转义，避免路径中的 cmd.exe 元字符导致提权后命令注入\n\tif err = validateExclusionPath(installPath); nil != err {\n\t\tlogging.LogWarnf(\"invalid Windows Defender exclusion path [%s]: %s\", installPath, err)\n\t\treturn\n\t}\n\tif err = validateExclusionPath(util.WorkspaceDir); nil != err {\n\t\tlogging.LogWarnf(\"invalid Windows Defender exclusion path [%s]: %s\", util.WorkspaceDir, err)\n\t\treturn\n\t}\n\n\tps := []string{\"add-defender-exclusion\", syscall.EscapeArg(installPath), syscall.EscapeArg(util.WorkspaceDir)}\n\tverbPtr, _ := syscall.UTF16PtrFromString(\"runas\")\n\texePtr, _ := syscall.UTF16PtrFromString(elevator)\n\tcwdPtr, _ := syscall.UTF16PtrFromString(util.WorkingDir)\n\targPtr, _ := syscall.UTF16PtrFromString(strings.Join(ps, \" \"))","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/elevator_windows.go#L47-L83","documentation":"Logged and returned by AddMicrosoftDefenderExclusion when the elevator binary (elevator.exe) is not found at the expected path. The elevator is a small helper that runs with admin privileges (ShellExecute 'runas') to add the SiYuan install/workspace paths to Windows Defender's exclusion list. Without it, Defender may scan and lock SiYuan's files, degrading performance.","triggerScenarios":"AddMicrosoftDefenderExclusion runs on Windows startup/first-run but the elevator.exe is missing from both util.WorkingDir/kernel/elevator.exe and util.WorkingDir/elevator/elevator-<GOARCH>.exe. Common in development builds ('dev' mode) or incomplete installations where the elevator wasn't packaged.","commonSituations":"Running from source in dev mode (elevator not built). Portable/custom install that didn't include the elevator binary. Antivirus quarantined elevator.exe. Wrong GOARCH build (e.g., 386 elevator on an amd64 install).","solutions":["If running in production, reinstall SiYuan from the official package which includes the elevator binary for your architecture.","If building from source, ensure the elevator is compiled and placed at kernel/elevator.exe or elevator/elevator-<GOARCH>.exe.","If Defender exclusion isn't critical, this warning is safe to ignore — SiYuan will still run, just potentially slower under active scans."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := model.AddMicrosoftDefenderExclusion(); err != nil {\n    if strings.Contains(err.Error(), \"not found elevator\") {\n        // non-fatal — SiYuan runs without Defender exclusion, just slower under scans\n        logging.LogWarnf(\"elevator not found, skipping Defender exclusion: %v\", err)\n    }\n}","preventionTips":["Use official SiYuan builds which bundle the elevator for each architecture.","If building from source, compile and place elevator.exe at the expected path.","Manually add the workspace exclusion in Windows Defender settings if the elevator is unavailable."],"tags":["windows","defender","elevator","permissions","platform-specific"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}