Redesign UI like Driver Navigator + fix CMD window
UI changes: - Top title bar with logo, app name, and system status LED - Toolbar with 4 icon tabs: Scan, Drivers, Download, System - Scan page with computer SVG illustration, stats, and big SCAN NOW button - Step indicator bar: Scan Devices > Review Drivers > Install Updates - Driver list with per-row progress bars, Download + Install buttons - "Update All Drivers" CTA bar at bottom when outdated drivers found - Windows Update tab with pending/installed sections - System Info tab with resource bars - Footer with About/Help buttons Backend fixes: - Add cmdutil.HiddenCommand() using CREATE_NO_WINDOW (0x08000000) - All PowerShell subprocesses now run without visible console window - Build with -ldflags "-H windowsgui" to hide main CMD window Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
internal/cmdutil/cmdutil.go
Normal file
16
internal/cmdutil/cmdutil.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package cmdutil
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// HiddenCommand creates an exec.Cmd that runs without showing a console window.
|
||||
// This prevents PowerShell/cmd flashing when the app runs as a GUI application.
|
||||
func HiddenCommand(name string, args ...string) *exec.Cmd {
|
||||
cmd := exec.Command(name, args...)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
CreationFlags: 0x08000000, // CREATE_NO_WINDOW
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
@@ -2,9 +2,10 @@ package drivers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/mumur/driver-booster/internal/cmdutil"
|
||||
)
|
||||
|
||||
type Driver struct {
|
||||
@@ -63,7 +64,7 @@ func (s *Scanner) enumDriversPnP() []Driver {
|
||||
psScript := `
|
||||
Get-CimInstance Win32_PnPSignedDriver | Where-Object { $_.DeviceName -ne $null } | Select-Object -First 100 DeviceName, DeviceClass, Manufacturer, DriverVersion, DriverDate, InfName, IsSigned, Status | ConvertTo-Json -Compress
|
||||
`
|
||||
out, err := exec.Command("powershell", "-NoProfile", "-Command", psScript).Output()
|
||||
out, err := cmdutil.HiddenCommand("powershell", "-NoProfile", "-Command", psScript).Output()
|
||||
if err != nil {
|
||||
return []Driver{}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@ package sysinfo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/mumur/driver-booster/internal/cmdutil"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -117,7 +118,7 @@ func getComputerName() string {
|
||||
}
|
||||
|
||||
func getCPUName() string {
|
||||
out, err := exec.Command("powershell", "-NoProfile", "-Command",
|
||||
out, err := cmdutil.HiddenCommand("powershell", "-NoProfile", "-Command",
|
||||
"(Get-CimInstance Win32_Processor).Name").Output()
|
||||
if err != nil {
|
||||
return "Unknown CPU"
|
||||
@@ -126,7 +127,7 @@ func getCPUName() string {
|
||||
}
|
||||
|
||||
func getWindowsProductName() string {
|
||||
out, err := exec.Command("powershell", "-NoProfile", "-Command",
|
||||
out, err := cmdutil.HiddenCommand("powershell", "-NoProfile", "-Command",
|
||||
"(Get-CimInstance Win32_OperatingSystem).Caption").Output()
|
||||
if err != nil {
|
||||
return "Windows"
|
||||
|
||||
@@ -2,8 +2,9 @@ package winupdate
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"github.com/mumur/driver-booster/internal/cmdutil"
|
||||
)
|
||||
|
||||
type Update struct {
|
||||
@@ -101,7 +102,7 @@ try {
|
||||
Pending = $pending
|
||||
} | ConvertTo-Json -Depth 3 -Compress
|
||||
`
|
||||
out, err := exec.Command("powershell", "-NoProfile", "-Command", psScript).Output()
|
||||
out, err := cmdutil.HiddenCommand("powershell", "-NoProfile", "-Command", psScript).Output()
|
||||
if err != nil {
|
||||
result.Error = "Failed to check updates: " + err.Error()
|
||||
result.CheckTime = time.Since(start).Round(time.Millisecond).String()
|
||||
@@ -193,7 +194,7 @@ if ($ToInstall.Count -gt 0) {
|
||||
Write-Output "No updates to install."
|
||||
}
|
||||
`
|
||||
out, err := exec.Command("powershell", "-NoProfile", "-Command", psScript).Output()
|
||||
out, err := cmdutil.HiddenCommand("powershell", "-NoProfile", "-Command", psScript).Output()
|
||||
if err != nil {
|
||||
return InstallResult{
|
||||
Success: false,
|
||||
|
||||
Reference in New Issue
Block a user