Add Store MSIX packaging and dark/light theme for 2.9.0.

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Navis
2026-08-01 14:12:30 +03:00
co-authored by Cursor
parent 93017e2076
commit d42202a1cf
17 changed files with 706 additions and 63 deletions
+16
View File
@@ -54,6 +54,7 @@ type UIState struct {
Pings []netcheck.Result `json:"pings"`
Subscription string `json:"subscription_url"`
Hy2 core.Hy2Options `json:"hy2"`
StorePackaged bool `json:"store_packaged,omitempty"`
}
type PingBestResult struct {
@@ -130,6 +131,7 @@ func (a *App) GetState() (UIState, error) {
Pings: append([]netcheck.Result(nil), a.Pings...),
Subscription: cfg.SubscriptionURL,
Hy2: a.Mgr.ActiveHy2Options(),
StorePackaged: update.IsStorePackaged(),
}
if out.Protocol == "" {
if p, err := cfg.ActiveProfile(); err == nil {
@@ -332,6 +334,9 @@ func (a *App) CheckUpdate() (update.Status, error) {
}
func (a *App) ApplyUpdate() (string, error) {
if update.IsStorePackaged() {
return "", fmt.Errorf("обновления устанавливаются через Microsoft Store")
}
// Explicit user action only — never called from AutoCheckUpdate.
st, err := a.CheckUpdate()
if err != nil {
@@ -361,6 +366,17 @@ func (a *App) ApplyUpdate() (string, error) {
func (a *App) AutoCheckUpdate() {
// Only check and populate status for the banner — never auto-apply.
// Auto-apply previously caused endless download→relaunch loops on Mac/Windows.
if update.IsStorePackaged() {
a.mu.Lock()
a.UpdateStatus = update.Status{
Current: update.DisplayVersion(),
ManifestURL: update.DefaultManifestURL,
StoreManaged: true,
Notes: "Обновления через Microsoft Store",
}
a.mu.Unlock()
return
}
time.Sleep(3 * time.Second)
_, _ = a.CheckUpdate()
}