From 3a76fea2d858a7a5ef58615f1cc9aabaa30b80ee Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Sat, 8 Aug 2026 21:59:32 +0200 Subject: fix: make windows installer swaps atomic (#2530) refs #2356 --- website/install.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'website') diff --git a/website/install.ps1 b/website/install.ps1 index b7ea80aa..d6367312 100644 --- a/website/install.ps1 +++ b/website/install.ps1 @@ -632,14 +632,15 @@ try { $backupDir = $null if (Test-Path -LiteralPath $releaseDir) { $backupDir = Join-Path $releasesDir ".backup.$releaseName.$([System.Guid]::NewGuid().ToString('N'))" - Move-Item -LiteralPath $releaseDir -Destination $backupDir + [System.IO.Directory]::Move($releaseDir, $backupDir) } try { - Move-Item -LiteralPath $stagingDir -Destination $releaseDir + [System.IO.Directory]::Move($stagingDir, $releaseDir) } catch { if ($null -ne $backupDir -and -not (Test-Path -LiteralPath $releaseDir)) { - Move-Item -LiteralPath $backupDir -Destination $releaseDir + [System.IO.Directory]::Move($backupDir, $releaseDir) } + Write-WarningStep "Windows could not activate the downloaded release. Another process may have a package file open, such as antivirus or indexing. No incomplete release was activated. Run herdr update again." throw } if ($null -ne $backupDir) { -- cgit v1.2.3