Files
MyGoNavi/internal/app/windows_update_script.go
Syngnat 3ac390f0dc 🐛 fix(update): 支持 Windows 便携版 ZIP 自动更新
- 将便携版更新资产切换为普通 ZIP,并兼容复用已下载包
- 解压后映射版本化目标文件名,保留旧版 EXE 更新兼容
- 将内嵌 PowerShell 更新脚本策略收紧为 RemoteSigned
- 补充 ZIP、目标路径与启动参数回归测试
2026-07-23 13:07:03 +08:00

29 lines
747 B
Go

package app
import (
_ "embed"
"strings"
)
//go:embed windows_update.ps1
var windowsUpdatePowerShellScript string
// The updater writes these embedded scripts locally, so RemoteSigned runs them without disabling policy checks.
const windowsUpdatePowerShellExecutionPolicy = "RemoteSigned"
type windowsUpdateLaunchContext struct {
SourcePath string
TargetPath string
CurrentTargetPath string
StagedDir string
LogPath string
MaintenanceEventName string
HandoffEventName string
PID int
}
func buildWindowsPowerShellScript() string {
normalized := strings.ReplaceAll(windowsUpdatePowerShellScript, "\r\n", "\n")
return strings.ReplaceAll(normalized, "\n", "\r\n")
}