Release v0.5.0: isolate screenshot editor and support manifest-based updates

This commit is contained in:
2026-10-28 22:52:52 +02:00
parent d1eabfca88
commit ccaa8dad3f
24 changed files with 498 additions and 51 deletions
+6
View File
@@ -40,3 +40,9 @@ for index in range(struct.unpack_from('<H', cursor, 4)[0]):
# Drawing point is the tip of the pencil, not the center of its image.
struct.pack_into('<HH', cursor, entry+4, round(size*4/28), round(size*24/28))
(root / 'pencil.cur').write_bytes(cursor)
# Original confirmation artwork, with native-resolution variants for display scaling.
question = root.parent / 'question.svg'
question_png = resvg_py.svg_to_bytes(svg_string=question.read_text(encoding='utf-8'), width=256, height=256)
Image.open(BytesIO(question_png)).convert('RGBA').save(
question.with_suffix('.ico'), sizes=[(s,s) for s in (16,20,24,32,40,48,64,96,128,256)])
+2
View File
@@ -1,6 +1,7 @@
$ErrorActionPreference = 'Stop'
$root = Split-Path $PSScriptRoot
try {
if (Get-Process 'KSwitcher.Screenshot' -ErrorAction SilentlyContinue | Where-Object { $_.Path -eq (Join-Path $root 'build\KSwitcher.Screenshot.exe') }) { throw 'Close screenshot editors before updating the development build.' }
$exe = Join-Path $root 'build\KSwitcher.exe'
$running = @(Get-Process KSwitcher -ErrorAction SilentlyContinue | Where-Object { $_.Path -eq $exe })
$stop = Start-Process -FilePath $exe -ArgumentList '--exit' -WindowStyle Hidden -PassThru
@@ -10,6 +11,7 @@ try {
foreach ($process in $config) { if (-not $process.WaitForExit(10000)) { throw 'Close the configurator before updating.' } }
Copy-Item -LiteralPath (Join-Path $root 'build\staged\KSwitcher.Config.exe') -Destination (Join-Path $root 'build\KSwitcher.Config.exe') -Force
Copy-Item -LiteralPath (Join-Path $root 'build\staged\KSwitcher.exe') -Destination $exe -Force
Copy-Item -LiteralPath (Join-Path $root 'build\staged\KSwitcher.Screenshot.exe') -Destination (Join-Path $root 'build\KSwitcher.Screenshot.exe') -Force
$eventName = 'Local\KSwitcher.Update.Started.' + [guid]::NewGuid().ToString('N')
$started = [System.Threading.EventWaitHandle]::new($false, [System.Threading.EventResetMode]::ManualReset, $eventName)
try {