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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user