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
+49
View File
@@ -0,0 +1,49 @@
//go:build windows
package update
import (
"sync"
"unsafe"
"golang.org/x/sys/windows"
)
const (
appModelErrorNoPackage = 15700 // APPMODEL_ERROR_NO_PACKAGE
errorInsufficientBuffer = 122 // ERROR_INSUFFICIENT_BUFFER
)
var (
storeOnce sync.Once
storePackaged bool
)
// IsStorePackaged reports whether this process has an MSIX / Store package identity.
// Store builds must not self-update (Store owns updates).
func IsStorePackaged() bool {
storeOnce.Do(func() {
storePackaged = detectStorePackage()
})
return storePackaged
}
func detectStorePackage() bool {
mod := windows.NewLazySystemDLL("kernel32.dll")
proc := mod.NewProc("GetCurrentPackageFullName")
if err := proc.Find(); err != nil {
return false
}
var n uint32
r, _, _ := proc.Call(uintptr(unsafe.Pointer(&n)), 0)
switch r {
case appModelErrorNoPackage:
return false
case errorInsufficientBuffer:
return true
case 0:
return n > 0
default:
return false
}
}