aboutsummaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorJJ Liebig <jonathan.liebig@gmail.com>2026-08-08 21:59:32 +0200
committerGitHub <noreply@github.com>2026-08-08 22:59:32 +0300
commit3a76fea2d858a7a5ef58615f1cc9aabaa30b80ee (patch)
tree8b19f9a758b594e79fa31f49a1242e52fdef06c6 /website
parent10974c822d607f03e20e9741ec027910f0c1f93a (diff)
fix: make windows installer swaps atomic (#2530)
refs #2356
Diffstat (limited to 'website')
-rw-r--r--website/install.ps17
1 files changed, 4 insertions, 3 deletions
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) {