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