🎨 Support one-click addition of Microsoft Defender exclusions https://github.com/siyuan-note/siyuan/issues/13650

This commit is contained in:
Daniel 2024-12-29 12:25:36 +08:00
parent 3d7baaba5f
commit 8ad7d6aae2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 8 additions and 7 deletions

View file

@ -70,5 +70,3 @@ extraResources:
- from: "src/assets/fonts"
to: "appearance/fonts"
filter: "!**/{.DS_Store}"
- from: "elevator/elevator-arm64.exe"
to: "elevator.exe"

View file

@ -71,5 +71,3 @@ extraResources:
filter: "!**/{.DS_Store}"
- from: "pandoc/pandoc-windows-amd64.zip"
to: "pandoc.zip"
- from: "elevator/elevator-amd64.exe"
to: "elevator.exe"

View file

@ -18,5 +18,6 @@
package model
func AutoProcessMicrosoftDefender() {
}
func AddMicrosoftDefenderExclusion() (err error) {}
func AutoProcessMicrosoftDefender() {}

View file

@ -63,7 +63,7 @@ func AddMicrosoftDefenderExclusion() (err error) {
}
} else {
logging.LogInfof("current user is not admin, use elevator to add Windows Defender exclusion path [%s, %s]", installPath, util.WorkspaceDir)
elevator := filepath.Join(util.WorkingDir, "elevator.exe")
elevator := filepath.Join(util.WorkingDir, "kernel", "elevator.exe")
if "dev" == util.Mode || !gulu.File.IsExist(elevator) {
elevator = filepath.Join(util.WorkingDir, "elevator", "elevator-"+runtime.GOARCH+".exe")
}

View file

@ -47,6 +47,10 @@ cd ..
echo 'Building Electron App amd64'
cd app
copy "elevator\elevator-amd64.exe" "kernel\elevator.exe"
copy "elevator\elevator-arm64.exe" "kernel-arm64\elevator.exe"
call pnpm run dist
if errorlevel 1 (
exit /b %errorlevel%