Releases: SamWylde/windows-keep-alive
Releases · SamWylde/windows-keep-alive
Release list
v1.9.0
What's Changed
- Added setup modes: keep-awake only, remote access watchdog, and full unattended auto-login.
- Made setup, restore, uninstall, and compliance checks mode-aware.
- Improved power keep-alive by using Windows Power Requests with a legacy fallback.
- Hardened setup failure handling so the app does not report stale completed setup state.
- Improved startup task user binding, uninstall cleanup, and release update behavior.
Verification
- Release build passed with warnings as errors.
- Formatting verification passed.
- Diff whitespace check passed.
SHA256 (KeepAliveService.exe): D4D26890F9B388F3D089AC400A837CAB739088A8188B6B3EE59E5B0C892A4A75
v1.8.0
What's Changed
Bug Fixes
- Lid close settings now actually apply — switched from unreliable alias-based
powercfgcommands to GUID-based commands, and addedpowercfg /setactiveto flush changes to the kernel. The lid close setting is now verified after applying. - Tray icon reliably appears after restart — the app now waits for explorer.exe shell readiness before showing the tray icon, and handles the
TaskbarCreatedmessage to survive explorer restarts. - Startup task correctly bound to auto-logon user — the scheduled task now uses PowerShell
Register-ScheduledTaskwith a user-specific logon trigger andInteractivelogon type, supporting Microsoft accounts, local accounts, and domain accounts. - Startup task auto-repair — on admin GUI launch, the app validates the startup task and silently recreates it if misconfigured.
- Startup task is now a critical setup step — setup will report failure if the startup task cannot be created.
Files Changed
PowerConfigurator.cs— GUID-based commands,/setactive, lid verificationNetworkConfigurator.cs—/setactiveafter WiFi/USB power settingsRestoreManager.cs— GUID-based restore,/setactiveStartupTaskManager.cs— PowerShell-based task creation, user binding, validationMainWindow.xaml.cs— shell wait, TaskbarCreated hook, auto-repairNativeMethods.cs—RegisterWindowMessageP/InvokeSetupManager.cs— startup task as critical step
Full Changelog: v1.7.1...v1.8.0
v1.7.1
What's Changed
- Fix startup rendering: Window no longer flashes with broken/dark rendering when launched via
--tray-startupduring Windows login - Show setup status: Setup tab now displays whether setup has been completed and when, so users know if they need to run it again
- Separate Restore & Uninstall: Restore reverts all Windows settings but keeps the program installed; Uninstall removes everything including the program itself
Install
Download KeepAliveService.exe below and run it as Administrator. It will self-install to C:\Program Files\WindowsKeepAlive\.
v1.7.0
What's New
Separate Restore and Uninstall
- Restore (
--restore) — reverts all Windows settings (power, registry, network), stops/removes the service and startup task, but leaves the program installed so you can re-run setup later - Uninstall (
--uninstall) — does a full restore and removes the program completely (desktop shortcut, installed EXE, program data)
The GUI now has separate Restore (yellow) and Uninstall (red) buttons.
Previous (v1.6.0)
- Expert code review fixes: deadlock prevention, thread safety, locale-independent power setting parsing, DPAPI credential protection, file locking for settings, and shared utility consolidation
v1.6.0
What's Changed
Critical Bug Fixes
- Fix process output deadlocks —
ServiceInstallerandStartupTaskManagernow use async stdout/stderr reads beforeWaitForExit, preventing deadlocks when pipe buffers fill - Fix unread redirected streams —
RestoreManager.RunPowerCfgno longer redirects streams it doesn't read - Fix legal notice backup/restore — backup and restore now use the correct registry hive (
Policies\System) matching where setup actually clears the values, with migration for existing backups - Fix service buttons stuck disabled — service Start/Stop/Restart buttons no longer remain permanently disabled after any operation completes
- Fix locale-dependent powercfg parsing — compliance checks and settings backup now use position-based hex parsing instead of matching English labels, working correctly on all Windows language packs
Robustness Improvements
- Cross-process settings safety —
AppSettings.Save()uses a named mutex with proper timeout handling; writes are skipped (not corrupted) if the lock can't be acquired - Corrupt settings preservation — corrupt
settings.jsonis preserved as.corruptfor diagnostics instead of being silently replaced with defaults - DPAPI password protection — saved encrypted passwords are no longer erased when DPAPI decryption fails (e.g., different user profile context)
- Console redirection race fix — timer-triggered update checks are skipped while compliance checks hold Console.Out/Error redirected
- Public desktop shortcut — desktop shortcut now uses the all-users desktop, preventing mismatch when setup runs under a different admin account
- Startup task user warning — warns when the process user doesn't match the configured autologon user
Code Quality
- Extracted shared
ConsoleOutputhelper (deduplicated from 6 files) - Extracted shared
IsVirtualAdaptermethod (deduplicated from 3 files) - Extracted shared
IsRunningAsAdminandFormatBytesutilities - All configurator failure counters are now
[ThreadStatic]for thread safety - Added
usingstatements for disposableStringWriter/TeeTextWriter - New
Helpers.ParsePowerCfgSettingValuesfor locale-independent power setting parsing
Full Changelog: v1.5.2...v1.6.0
v1.5.2
Bug Fixes
- Fix startup crash (NullReferenceException) — XAML event handlers firing during
InitializeComponent()before timers were initialized. Suppression flag now set before XAML parsing, with null guard as defense-in-depth. - Fix IOException when exe is locked by running service — Auto-update now stops the service before overwriting the exe, then retries.
If you are on v1.5.0 or v1.5.1, this update will be applied automatically within 24 hours, or you can click "Check Now" on the Updates tab.
v1.5.1
Bug fixes
- Eliminate double UAC prompt — first-run install no longer triggers two elevation prompts; the relaunch from Program Files now carries admin elevation forward
- Fix output writer thread safety —
Write(string)now holds the lock for the entire string instead of per-character, preventing interleaved output from concurrent threads - Cap UI output buffer — FlowDocument Inlines are trimmed to 5,000 lines (oldest removed first), preventing memory growth during long GUI sessions
- Flush output on shutdown — the output writer is flushed before restoring console, so the last line of output is no longer lost
- Guard dispatcher shutdown —
ActivateFromExternalLaunchnow checksHasShutdownStartedbefore dispatching, consistent with the output writer guard - Dispose tray icon handle — the extracted GDI icon is now properly disposed on cleanup
- Preserve update status text — running setup, compliance checks, or service operations no longer resets the "Update available" status strip text
- Fix Close() during update — window close after applying an update now happens after
RunOperationAsyncreturns, avoiding access to disposed controls
Upgrading
Existing installations will auto-update via the built-in updater. No manual steps required.
v1.5.0
What's new
WPF GUI migration
- Replaced the WinForms interface with a modern WPF GUI using the WPF-UI library (Fluent Design, Mica backdrop)
- Clean light theme with tabbed layout: Setup, Status, Updates, Logs
- Single-file EXE now bundles all WPF native dependencies (~162 MB)
Bug fixes
- Session shutdown: the window close handler no longer blocks OS shutdown or logoff — only user-initiated close minimizes to tray
- Dispatcher teardown: output writer guards against dispatcher shutdown, preventing intermittent errors during app exit
- Accessibility: status-bar Copy/Clear controls are now keyboard-focusable buttons instead of mouse-only text blocks
- Gitignore: publish artifacts and scratch files are now excluded from source control
Upgrading
Existing installations will auto-update via the built-in updater. No manual steps required.
v1.4.0
What's New
Auto Light/Dark Theming
- Detects Windows theme preference and applies matching palette
- Live theme switching — changes instantly when you toggle Windows dark mode
- Centralized palette with button hierarchy (primary, secondary, destructive)
Settings Backup & Restore
- Full settings backup captured before setup modifies the system
--restoreCLI command to roll back all changes (registry, service, startup task, shortcuts)- Write-once backup guard prevents accidental overwrite
- Restore preserves backup on partial failure for retry
Startup Task Auto-Start
- Scheduled task launches the app minimized to tray on user login
--tray-startupflag for silent tray-only launch- Task managed via
schtasks.exeunder the interactive user principal
Audit Hardening
- Compliance watchdog correctly skips startup task check (runs as SYSTEM, can't create user-session tasks)
- Service uninstall returns success/failure for reliable restore verification
- AppSettings merge pattern prevents stale-object backup overwrite
- Backup gated on admin check to prevent write-once poisoning from non-admin runs
v1.3.0
What's New in v1.3.0
Compliance Watchdog
- Automatic drift remediation: The service now checks all settings every 6 hours and automatically re-applies any that have drifted (e.g., after Windows Update)
- Rate-limited to 3 consecutive failures before entering 24-hour cooldown
Power Compliance Fixes
- Fixed false failures for lid close action and console lock on Win10 Home builds where
powercfg /querydoesn't return AC/DC index lines — now reports WARN instead of FAIL - Removed
/setactive SCHEME_CURRENTcalls that could reset custom power values on some builds - Replaced custom lid close action checker with the robust generic power setting checker
Network Adapter Filter
- Expanded virtual adapter exclusion to skip WAN Miniport, TAP, Kernel Debug, Bluetooth, and Microsoft protocol adapters
- Only real physical adapters (WiFi, Ethernet) now have power management disabled
Auto-Fix Preflight Blockers
- LegalNoticeText/LegalNoticeCaption automatically cleared if set (previously hard-blocked setup)
- DontDisplayLastUserName automatically set to 0 if enabled
- Credential Guard automatically disabled via registry if detected
- All blockers also checked and fixed by the compliance watchdog
Auto-Login Hardening
- ForceAutoLogon re-applied by watchdog to survive Windows Update resets
- AutoLogonCount automatically removed if set (prevents auto-login from expiring)
GUI Improvements
- First-run "Setup not completed" indicator on Status tab
- State-aware service Start/Stop/Restart buttons (disabled when not applicable)
- Tooltips on all interactive controls
- Uninstall button visually distinct (red text)
- Password visibility toggle
- Color-coded compliance status (green/yellow/red)
- Status tab auto-rechecks compliance on every visit (with 30s debounce)
- Consistent dark theme across all output boxes
- "Last checked" timestamp on Updates tab (new)
- Startup update check now logged in output (new)