From 584872eb9a95b51dc031247ac12e98e6aab5935b Mon Sep 17 00:00:00 2001 From: Kodumulo <2120120014@student.kopo.ac.kr> Date: Tue, 15 Jul 2025 17:43:23 +0900 Subject: [PATCH] [V3] fix: enhance doctor command to verify Windows SDK dependencies (#4392) * fix: enhance doctor command to verify Windows SDK dependencies ([#4390](https://github.com/wailsapp/wails/issues/4390)) - Updated the doctor command to check for the presence of Windows SDK dependencies, improving the setup process for Windows users. - Added relevant entry to the changelog for better documentation of this fix. * Update changelog --------- Co-authored-by: Lea Anthony --- docs/src/content/docs/changelog.mdx | 6 ++++++ v3/internal/doctor/doctor_windows.go | 26 ++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index e3e3668bf..8f17efcb6 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -24,8 +24,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 */ ## [Unreleased] + +### Added - `app.Env.GetAccentColor` to get the accent color of a user's system. Works on MacOS. by [@etesam913](https://github.com/etesam913) +### Fixed +- Fixed doctor command to check for Windows SDK dependencies by [@kodumulo](https://github.com/kodumulo) in [#4390](https://github.com/wailsapp/wails/issues/4390) + + ## v3.0.0-alpha.11 - 2025-07-12 ## Added diff --git a/v3/internal/doctor/doctor_windows.go b/v3/internal/doctor/doctor_windows.go index 607b689fa..2ae1dd2c8 100644 --- a/v3/internal/doctor/doctor_windows.go +++ b/v3/internal/doctor/doctor_windows.go @@ -3,10 +3,11 @@ package doctor import ( - "github.com/samber/lo" - "github.com/wailsapp/go-webview2/webviewloader" "os/exec" "strings" + + "github.com/samber/lo" + "github.com/wailsapp/go-webview2/webviewloader" ) func getInfo() (map[string]string, bool) { @@ -43,12 +44,25 @@ func getMakeAppxVersion() string { func getMSIXPackagingToolVersion() string { // Check if MSIX Packaging Tool is installed // Use PowerShell to check if the app is installed from Microsoft Store - cmd := exec.Command("powershell", "-Command", "Get-AppxPackage -Name Microsoft.MsixPackagingTool") + cmd := exec.Command("powershell", "-Command", "Get-AppxPackage -Name Microsoft.MSIXPackagingTool") output, err := cmd.Output() - if err != nil || len(output) == 0 || !strings.Contains(string(output), "Microsoft.MsixPackagingTool") { + if err != nil || len(output) == 0 || !strings.Contains(string(output), "Microsoft.MSIXPackagingTool") { return "Not Installed" } - return "Installed" + + if strings.Contains(string(output), "Version") { + lines := strings.Split(string(output), "\n") + for _, line := range lines { + if strings.Contains(line, "Version") { + parts := strings.Split(line, ":") + if len(parts) > 1 { + return strings.TrimSpace(parts[1]) + } + } + } + } + + return "Installed (Version Unknown)" } func getSignToolVersion() string { @@ -64,7 +78,7 @@ func checkPlatformDependencies(result map[string]string, ok *bool) { checkCommonDependencies(result, ok) // add nsis result["NSIS"] = getNSISVersion() - + // Add MSIX tooling checks result["MakeAppx.exe (Windows SDK)"] = getMakeAppxVersion() result["MSIX Packaging Tool"] = getMSIXPackagingToolVersion()