fix: defer cleanup of locked Windows runtimes

This commit is contained in:
reaper
2026-08-28 09:22:56 -05:00
parent e29133613a
commit 539a6b3fab
3 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "aurora-dockside",
"version": "2.0.0-alpha.39",
"version": "2.0.0-alpha.40",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "aurora-dockside",
"version": "2.0.0-alpha.39",
"version": "2.0.0-alpha.40",
"hasInstallScript": true,
"dependencies": {
"@electron-toolkit/preload": "^3.0.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "aurora-dockside",
"version": "2.0.0-alpha.39",
"version": "2.0.0-alpha.40",
"description": "A modern, modular Docker development platform for building, running, and managing web applications locally.",
"desktopName": "aurora-dockside.desktop",
"main": "./out/main/index.js",
+10 -5
View File
@@ -131,7 +131,7 @@ export async function installNativeRuntimeArchive(source: string): Promise<Auror
await mkdir(runtimes, { recursive: true })
const staging = await mkdtemp(join(runtimes, '.install-'))
const target = runtimeRoot()
const backup = `${target}.previous`
const backup = `${target}.previous-${Date.now()}`
try {
const { stdout } = await execFileAsync('tar', ['-tzf', source], { maxBuffer: 16 * 1024 * 1024 })
validateArchiveEntries(stdout)
@@ -148,15 +148,20 @@ export async function installNativeRuntimeArchive(source: string): Promise<Auror
)
await rejectLinks(staging)
await verifyRuntimeAt(staging)
await rm(backup, { recursive: true, force: true })
try {
await rename(target, backup)
} catch {
/* first installation */
} catch (error) {
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
}
try {
await rename(staging, target)
await rm(backup, { recursive: true, force: true })
try {
await rm(backup, { recursive: true, force: true })
} catch (error) {
// Windows keeps running executables locked. The uniquely named rollback folder can be
// removed after those old processes exit and must never block the new runtime install.
console.warn('Previous Aurora Native runtime is still in use; cleanup was deferred:', error)
}
} catch (error) {
try {
await rename(backup, target)