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", "name": "aurora-dockside",
"version": "2.0.0-alpha.39", "version": "2.0.0-alpha.40",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "aurora-dockside", "name": "aurora-dockside",
"version": "2.0.0-alpha.39", "version": "2.0.0-alpha.40",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@electron-toolkit/preload": "^3.0.2", "@electron-toolkit/preload": "^3.0.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "aurora-dockside", "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.", "description": "A modern, modular Docker development platform for building, running, and managing web applications locally.",
"desktopName": "aurora-dockside.desktop", "desktopName": "aurora-dockside.desktop",
"main": "./out/main/index.js", "main": "./out/main/index.js",
+9 -4
View File
@@ -131,7 +131,7 @@ export async function installNativeRuntimeArchive(source: string): Promise<Auror
await mkdir(runtimes, { recursive: true }) await mkdir(runtimes, { recursive: true })
const staging = await mkdtemp(join(runtimes, '.install-')) const staging = await mkdtemp(join(runtimes, '.install-'))
const target = runtimeRoot() const target = runtimeRoot()
const backup = `${target}.previous` const backup = `${target}.previous-${Date.now()}`
try { try {
const { stdout } = await execFileAsync('tar', ['-tzf', source], { maxBuffer: 16 * 1024 * 1024 }) const { stdout } = await execFileAsync('tar', ['-tzf', source], { maxBuffer: 16 * 1024 * 1024 })
validateArchiveEntries(stdout) validateArchiveEntries(stdout)
@@ -148,15 +148,20 @@ export async function installNativeRuntimeArchive(source: string): Promise<Auror
) )
await rejectLinks(staging) await rejectLinks(staging)
await verifyRuntimeAt(staging) await verifyRuntimeAt(staging)
await rm(backup, { recursive: true, force: true })
try { try {
await rename(target, backup) await rename(target, backup)
} catch { } catch (error) {
/* first installation */ if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
} }
try { try {
await rename(staging, target) await rename(staging, target)
try {
await rm(backup, { recursive: true, force: true }) 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) { } catch (error) {
try { try {
await rename(backup, target) await rename(backup, target)