feat(windows): 支持 MSI 主程序严格单实例启动

- 仅对带 MSI 安装标识的 Windows 主程序启用单实例门禁,Portable 与特殊运行模式保持原行为
- 重复启动通过命名事件唤醒首个窗口,并兼容 Wails 运行时尚未就绪的激活请求
- 新增并发抢占、窗口激活与安装模式测试,覆盖同一安装仅保留一个主实例
This commit is contained in:
Syngnat
2026-07-21 10:49:52 +08:00
parent b75fd37b05
commit 2597d087ad
6 changed files with 296 additions and 0 deletions

View File

@@ -31,6 +31,12 @@ func resolveCurrentUpdateInstallMode() updateInstallMode {
return resolveUpdateInstallModeForExecutable(runtime.GOOS, updateResolveInstallTarget())
}
// IsWindowsMSIInstallExecutable reports whether executablePath belongs to a
// GoNavi MSI installation. The marker is packaged next to the stable MSI exe.
func IsWindowsMSIInstallExecutable(goos string, executablePath string) bool {
return resolveUpdateInstallModeForExecutable(goos, executablePath) == updateInstallModeMSI
}
func resolveUpdateInstallModeForExecutable(goos string, executablePath string) updateInstallMode {
if !strings.EqualFold(strings.TrimSpace(goos), "windows") {
return updateInstallModeUnknown