Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

test: windows update in place

ogsamratb271633c6e7f
diff --git a/.github/workflows/build-electron-desktop.yml b/.github/workflows/build-electron-desktop.yml
index eb09de20..489d1959 100644
--- a/.github/workflows/build-electron-desktop.yml
+++ b/.github/workflows/build-electron-desktop.yml
@@ -71,6 +71,44 @@ jobs:
name: omnirush-electron-${{ matrix.artifact }}
path: apps/desktop/dist-electron/**
+ windows-update-check:
+ name: Windows update in place
+ runs-on: windows-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: 11.4.0
+
+ - name: Setup Node
+ uses: actions/setup-node@v6
+ with:
+ node-version: 24
+
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: 1.3.10
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ # A version above the latest release, as a real update would carry.
+ - name: Build the Windows installer
+ shell: bash
+ run: |
+ set -euo pipefail
+ pnpm --filter @omnirush/desktop run build:electron
+ pnpm --dir apps/desktop exec electron-builder --config electron-builder.yml --win nsis --x64 --publish never -c.extraMetadata.version=99.0.0
+
+ - name: Update the latest release in place
+ shell: pwsh
+ run: scripts/release/check-windows-update.ps1 -NewInstaller (Get-ChildItem apps/desktop/dist-electron/*.exe | Select-Object -First 1).FullName
+
electron-macos-notarization-smoke:
name: Electron macOS notarization smoke
runs-on: macos-14
diff --git a/scripts/release/check-windows-update.ps1 b/scripts/release/check-windows-update.ps1
new file mode 100644
index 00000000..516de276
--- /dev/null
+++ b/scripts/release/check-windows-update.ps1
@@ -0,0 +1,51 @@
+# Installs the latest published Windows release, then installs a new build over
+# it the way the in-app updater does (`/S --updated`), and checks the result is
+# one app in the same folder with its data kept and its shortcuts renamed.
+# Usage: pwsh scripts/release/check-windows-update.ps1 <new-installer.exe>
+param([Parameter(Mandatory = $true)][string]$NewInstaller)
+$ErrorActionPreference = "Stop"
+
+function Get-Installs {
+ Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue |
+ Where-Object { $_.DisplayName -match "omnirush" }
+}
+function Get-Shortcuts {
+ $places = @("$env:APPDATA\Microsoft\Windows\Start Menu\Programs", [Environment]::GetFolderPath("Desktop"))
+ Get-ChildItem $places -Filter *.lnk -Recurse -ErrorAction SilentlyContinue |
+ Where-Object { $_.Name -match "omnirush" } | ForEach-Object { $_.FullName }
+}
+function Show-State($label) {
+ Write-Host "== $label"
+ Get-Installs | ForEach-Object { Write-Host "uninstall entry: $($_.DisplayName) at $($_.InstallLocation)" }
+ Get-Shortcuts | ForEach-Object { Write-Host "shortcut: $_" }
+}
+
+$manifest = (Invoke-WebRequest -UseBasicParsing "https://github.com/omnirush-ai/omnirush-gui/releases/latest/download/latest.yml").Content
+$latest = [regex]::Match($manifest, "(?m)^version:\s*(\S+)").Groups[1].Value
+$old = Join-Path $env:RUNNER_TEMP "omnirush-$latest.exe"
+Invoke-WebRequest -UseBasicParsing "https://github.com/omnirush-ai/omnirush-gui/releases/download/v$latest/omnirush-win-x64-$latest.exe" -OutFile $old
+Start-Process -Wait -FilePath $old -ArgumentList "/S"
+Show-State "installed v$latest"
+$before = @(Get-Installs)
+if ($before.Count -ne 1) { throw "expected one install of v$latest" }
+$folder = $before[0].InstallLocation
+
+# A file in the app's data folder (keyed by the app id) must survive the update.
+$data = Join-Path $env:APPDATA "ai.omnirush.desktop"
+New-Item -ItemType Directory -Force $data | Out-Null
+Set-Content (Join-Path $data "update-check-marker.txt") "kept"
+
+Start-Process -Wait -FilePath (Resolve-Path $NewInstaller) -ArgumentList "/S", "--updated"
+Show-State "after the update"
+$after = @(Get-Installs)
+if ($after.Count -ne 1) { throw "expected one install after the update, found $($after.Count)" }
+if ($after[0].InstallLocation -ne $folder) { throw "the update moved the app from $folder to $($after[0].InstallLocation)" }
+$exe = Get-ChildItem $folder -Filter *.exe | Where-Object { $_.Name -notmatch "^Uninstall" }
+$exe | ForEach-Object { Write-Host "executable: $($_.Name) $($_.VersionInfo.ProductVersion)" }
+if (@($exe).Count -ne 1) { throw "expected one app executable in $folder" }
+$shortcuts = @(Get-Shortcuts)
+$stale = $shortcuts | Where-Object { (Split-Path $_ -Leaf) -cmatch "OmniRush\.ai" }
+if ($stale) { throw "old shortcuts left behind: $stale" }
+if (-not ($shortcuts | Where-Object { (Split-Path $_ -Leaf) -eq "omnirush.lnk" })) { throw "no omnirush shortcut" }
+if ((Get-Content (Join-Path $data "update-check-marker.txt")) -ne "kept") { throw "app data was lost" }
+Write-Host "update in place: one install in $folder, data kept, shortcuts renamed"