From 6f9046db1d7a761484213881a9e3009ee26c6c3a Mon Sep 17 00:00:00 2001 From: drew Date: Sun, 22 Mar 2026 00:37:30 +0400 Subject: [PATCH 1/2] feat: add auto-update via winget Signed-off-by: drew --- main.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/main.go b/main.go index e8e5e3c..cf5083d 100644 --- a/main.go +++ b/main.go @@ -1743,6 +1743,25 @@ func detectInstalledVersion() string { } } + // Try WinGet (Windows) + if runtime.GOOS == "windows" { + if _, err := exec.LookPath("winget"); err == nil { + if out, err := exec.Command("winget", "list", "--id", "floatpane.matcha", "--disable-interactivity").Output(); err == nil { + lines := strings.Split(strings.TrimSpace(string(out)), "\n") + for _, line := range lines { + if strings.Contains(strings.ToLower(line), "floatpane.matcha") { + fields := strings.Fields(line) + for _, f := range fields { + if len(f) > 0 && f[0] >= '0' && f[0] <= '9' && strings.Contains(f, ".") { + return f + } + } + } + } + } + } + } + // Try snap (Linux) if runtime.GOOS == "linux" { if _, err := exec.LookPath("snap"); err == nil { @@ -1897,6 +1916,23 @@ func runUpdateCLI() error { } } + // Detect WinGet + if _, err := exec.LookPath("winget"); err == nil { + cmdCheck := exec.Command("winget", "list", "--id", "floatpane.matcha", "--disable-interactivity") + if err := cmdCheck.Run(); err == nil { + fmt.Println("Detected WinGet package — attempting to upgrade.") + cmd := exec.Command("winget", "upgrade", "--id", "floatpane.matcha", "--disable-interactivity") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err == nil { + fmt.Println("Successfully upgraded via WinGet.") + return nil + } + fmt.Printf("WinGet upgrade failed: %v\n", err) + // fallthrough + } + } + // Otherwise attempt to download the proper release asset and replace the binary. osName := runtime.GOOS arch := runtime.GOARCH From 120e95c1d3ffbc4378bc4abc7218bb2d15d9bafb Mon Sep 17 00:00:00 2001 From: drew Date: Sun, 22 Mar 2026 00:37:53 +0400 Subject: [PATCH 2/2] docs: add winget installation Signed-off-by: drew --- docs/docs/installation.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/docs/installation.md b/docs/docs/installation.md index 4697e00..7044989 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -102,6 +102,12 @@ You can download pre-compiled binaries from the [Releases page](https://github.c ## 🪟 Windows +### Winget is the recommended way to install Matcha on Windows. + +```powershell +winget install --id=floatpane.matcha +``` + ### Manual Binary Download You can download pre-compiled binaries from the [Releases page](https://github.com/floatpane/matcha/releases). @@ -117,8 +123,6 @@ You can download pre-compiled binaries from the [Releases page](https://github.c Type or paste the full path to the folder where your executable is located (e.g., C:\CLI Tools\MyTool\). Click "OK" on all open windows to save the changes. -> Matcha will be added to WinGet as soons as possible! - ### WSL You can run Matcha on Windows using [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install).