fix: defer cleanup of locked Windows runtimes
This commit is contained in:
Generated
+2
-2
@@ -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
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user