From cecefce84d22e52cf52134f8ed9c252735f47285 Mon Sep 17 00:00:00 2001 From: Syngnat <92659908+Syngnat@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:35:02 +0800 Subject: [PATCH] fix(update): keep script builder test compatibility --- internal/app/update_cleanup.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/app/update_cleanup.go b/internal/app/update_cleanup.go index 4991abc..1a0b3d7 100644 --- a/internal/app/update_cleanup.go +++ b/internal/app/update_cleanup.go @@ -59,7 +59,7 @@ func launchWindowsUpdateWithCleanup(staged *stagedUpdate, targetExe string, pid }) scriptPath := filepath.Join(staged.StagedDir, "update.cmd") - content := buildWindowsScriptWithCleanup(staged.FilePath, finalTargetExe, currentTargetExe, staged.StagedDir, staged.InstallLogPath, pid) + content := buildWindowsScriptWithCurrentTargetCleanup(staged.FilePath, finalTargetExe, currentTargetExe, staged.StagedDir, staged.InstallLogPath, pid) if err := os.WriteFile(scriptPath, []byte(content), 0o644); err != nil { return err } @@ -218,7 +218,11 @@ func cleanComparablePath(path string) string { return cleaned } -func buildWindowsScriptWithCleanup(source, target, currentTarget, stagedDir, logPath string, pid int) string { +func buildWindowsScriptWithCleanup(source, target, stagedDir, logPath string, pid int) string { + return buildWindowsScriptWithCurrentTargetCleanup(source, target, target, stagedDir, logPath, pid) +} + +func buildWindowsScriptWithCurrentTargetCleanup(source, target, currentTarget, stagedDir, logPath string, pid int) string { script := `@echo off setlocal EnableExtensions EnableDelayedExpansion set "SOURCE=__GONAVI_UPDATE_SOURCE__"