diff --git a/CMakeLists.txt b/CMakeLists.txt index 23008ef..91e8de5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.24) -project(KSwitcher VERSION 0.2.1 LANGUAGES CXX RC) +project(KSwitcher VERSION 0.2.2 LANGUAGES CXX RC) if(NOT WIN32) message(FATAL_ERROR "KSwitcher uses native Windows APIs") endif() diff --git a/Release/KSwitcher-win-x64.zip b/Release/KSwitcher-win-x64.zip index 2bb11d7..55b1872 100644 Binary files a/Release/KSwitcher-win-x64.zip and b/Release/KSwitcher-win-x64.zip differ diff --git a/Release/README.md b/Release/README.md index 15cb41d..6cd0c83 100644 --- a/Release/README.md +++ b/Release/README.md @@ -1,21 +1,13 @@ # Latest Windows release -## v0.2.1 — 2026-10-28 +## v0.2.2 — 2026-10-28 -- Accept keyboard and mouse input forwarded by Microsoft Mouse Without Borders, including hotkey - releases, repeated presses, recent-word conversion and snippets. Mark KSwitcher's own generated - input to prevent recursive commands and preserve text-operation validation. -- Add **Update** to the tray menu and a non-installing startup check against this repository's - Releases. Verify the x64 ZIP, SHA-256, executable identity and version before closing; restart - automatically and roll back on replacement/startup failure. Keep settings, history and existing dictionaries. -- Fix initial window sizing on high-DPI monitors. Size the frame and controls from the same monitor - DPI, recover windows after display changes, and provide resizing, scrolling and focus visibility - when the available work area is smaller than the contents. +- Fix the garbled dash in the executable description shown by Task Manager and Windows file properties. +- Explicitly compile the UTF-8 Windows resource source as UTF-8, both in the resource file and the portable build command. +- Add regression checks against the compiled executable's version and exact Unicode description. -Verified: 168 native checks, 51 input/layout checks (including hidden Settings at 240 DPI), -24 offline updater checks, live release download/checksum/package validation, and visible Settings -at 250% scaling. Two-laptop Mouse Without Borders use and physically disconnecting a monitor still -require hardware verification. +Verified: 168 native checks, 51 input/layout checks, and 26 updater/metadata checks. +The executable description is `KSwitcher — native keyboard and clipboard utility`. Download **KSwitcher-win-x64.zip**, extract the entire archive to a writable folder, and launch `KSwitcher.exe`. Keep `dictionaries/` next to the executable. diff --git a/Release/SHA256SUMS.txt b/Release/SHA256SUMS.txt index 64e99f9..a63b8d1 100644 --- a/Release/SHA256SUMS.txt +++ b/Release/SHA256SUMS.txt @@ -1 +1 @@ -e33c372d1401c5500f3b07b38c10aff9667a5b1db9f6e613420e7878202853b3 KSwitcher-win-x64.zip +9705cdb0c0a732eeae10b88e42101f9ff6714399ea8779e154fecc79269059a0 KSwitcher-win-x64.zip diff --git a/build.ps1 b/build.ps1 index 423eb7f..f47c409 100644 --- a/build.ps1 +++ b/build.ps1 @@ -18,7 +18,7 @@ try { & $compiler @common -c "src/$name.cpp" -o "build/$name.o" if ($LASTEXITCODE) { throw "Compilation failed: $name" } } - & windres resources/app.rc -O coff -o build/app-res.o + & windres --codepage=65001 resources/app.rc -O coff -o build/app-res.o if ($LASTEXITCODE) { throw 'Resource compilation failed' } New-Item -ItemType Directory -Force build/release | Out-Null & $compiler -mwindows -municode -static -s '-Wl,--gc-sections' build/core.o build/platform.o build/autostart.o build/autocorrect.o build/storage.o build/ocr.o build/richtext.o build/update.o build/app.o build/ui.o build/main.o build/app-res.o @libs -o $executablePath diff --git a/resources/app.rc b/resources/app.rc index 6a79a0f..8f61155 100644 --- a/resources/app.rc +++ b/resources/app.rc @@ -1,11 +1,12 @@ +#pragma code_page(65001) #include #include "resource.h" IDI_KSWITCHER ICON "kswitcher.ico" 1 RT_MANIFEST "app.manifest" 201 RCDATA "update.ps1" 1 VERSIONINFO - FILEVERSION 0,2,1,0 - PRODUCTVERSION 0,2,1,0 + FILEVERSION 0,2,2,0 + PRODUCTVERSION 0,2,2,0 FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_APP BEGIN @@ -15,7 +16,7 @@ BEGIN BEGIN VALUE "FileDescription", "KSwitcher — native keyboard and clipboard utility" VALUE "ProductName", "KSwitcher" - VALUE "FileVersion", "0.2.1" + VALUE "FileVersion", "0.2.2" END END BLOCK "VarFileInfo" diff --git a/src/app.cpp b/src/app.cpp index 758b6af..af53cf7 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1134,7 +1134,7 @@ void App::trayMenu() break; case 16: MessageBoxW(window, - L"KSwitcher 0.2.1\nNative C++ / Win32 keyboard and clipboard utility\n\nBased on " + L"KSwitcher 0.2.2\nNative C++ / Win32 keyboard and clipboard utility\n\nBased on " L"Typlo by bitcodepro. MIT license.\nHistory is encrypted for your Windows " L"account.\nNo .NET, WebView or graphics framework.", L"About KSwitcher", MB_OK); diff --git a/src/update.h b/src/update.h index f60d18e..6e4b8c2 100644 --- a/src/update.h +++ b/src/update.h @@ -2,7 +2,7 @@ #include "platform.h" namespace ks { -inline constexpr wchar_t AppVersion[] = L"0.2.1"; +inline constexpr wchar_t AppVersion[] = L"0.2.2"; inline constexpr UINT UpdateMessage = WM_APP + 7; struct UpdateResult { diff --git a/tests/update.ps1 b/tests/update.ps1 index 70da63b..717901d 100644 --- a/tests/update.ps1 +++ b/tests/update.ps1 @@ -7,6 +7,10 @@ function Reject([scriptblock]$Action,[string]$Name) { $rejected=$false; try { & $root=Join-Path ([IO.Path]::GetTempPath()) ('KSwitcher-update-tests-'+[guid]::NewGuid().ToString('N')) [IO.Directory]::CreateDirectory($root) | Out-Null try { + $binaryInfo = [Diagnostics.FileVersionInfo]::GetVersionInfo((Resolve-Path -LiteralPath $Executable).Path) + $binaryVersion = Get-StableVersion $binaryInfo.FileVersion + Assert ($null -ne $binaryVersion) 'executable has a stable version' + Assert ($binaryInfo.FileDescription -ceq ('KSwitcher ' + [char]0x2014 + ' native keyboard and clipboard utility')) 'executable description preserves Unicode em dash' Assert ((Get-StableVersion 'v0.10.0') -gt (Get-StableVersion 'v0.2.9')) 'numeric versions' Assert ($null -eq (Get-StableVersion 'v1.0.0-beta')) 'prerelease rejected' Assert ($null -eq (Get-StableVersion 'v1.0.0;whoami')) 'invalid version rejected' @@ -36,7 +40,7 @@ try { ((Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash+' KSwitcher-win-x64.zip') | Set-Content -LiteralPath $sum Assert-Checksum $archive $sum; ++$script:checks $stage=Join-Path $root 'stage' - Expand-Release $archive $stage ([version]'0.2.1'); ++$script:checks + Expand-Release $archive $stage $binaryVersion; ++$script:checks Reject { Expand-Release $archive (Join-Path $root 'wrong-version') ([version]'9.0.0') } 'version mismatch rejected' ('0'*64+' KSwitcher-win-x64.zip') | Set-Content -LiteralPath $sum Reject { Assert-Checksum $archive $sum } 'corrupt package rejected'