fix(scan): also clear AE AppStates registry to stop Safe Mode 'Crash Repair' dialog
Build backend images / build content-svc (push) Failing after 2m1s
Build backend images / build file-svc (push) Failing after 1m0s
Build backend images / build gateway (push) Failing after 56s
Build backend images / build identity-svc (push) Failing after 54s
Build backend images / build notification-svc (push) Failing after 54s
Build backend images / build render-svc (push) Failing after 46s
Build backend images / build studio-svc (push) Failing after 48s
Build backend images / build content-svc (push) Failing after 2m1s
Build backend images / build file-svc (push) Failing after 1m0s
Build backend images / build gateway (push) Failing after 56s
Build backend images / build identity-svc (push) Failing after 54s
Build backend images / build notification-svc (push) Failing after 54s
Build backend images / build render-svc (push) Failing after 46s
Build backend images / build studio-svc (push) Failing after 48s
SCRPriorState.json alone didn't suppress it — AE's per-session GUID under HKCU\Software\Adobe\After Effects\AppStates persists after a kill/crash and trips Safe Mode. ClearAECrashState now reg-deletes AppStates too (reg.exe, no dep). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -2,29 +2,38 @@ package runner
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ClearAECrashState removes After Effects' session crash-recovery marker
|
// ClearAECrashState removes the markers After Effects uses to decide it crashed,
|
||||||
// (SCRPriorState.json) from every AE prefs version dir. AE checks this file at
|
// so the blocking "Crash Repair Options" (Safe Mode) dialog never appears on a
|
||||||
// startup; if it indicates an unclean prior session it shows the blocking
|
// headless launch. Two parts:
|
||||||
// "Crash Repair Options" dialog — which would hang a headless afterfx/aerender
|
|
||||||
// launch. Deleting it (vs. wiping all prefs) keeps the node's prefs intact.
|
|
||||||
//
|
//
|
||||||
// Safe no-op when APPDATA is unset (non-Windows / dev).
|
// 1. SCRPriorState.json in each AE prefs version dir (session crash-recovery state).
|
||||||
|
// 2. HKCU\Software\Adobe\After Effects\AppStates — AE writes a per-session GUID
|
||||||
|
// subkey on startup and removes it on a clean exit; a leftover one (after a
|
||||||
|
// kill/crash) triggers Safe Mode. reg.exe is a Windows built-in (no external
|
||||||
|
// dep / cgo), so we shell out to it.
|
||||||
|
//
|
||||||
|
// Targeted (vs. wiping all prefs) so the node keeps its AE preferences. Safe no-op
|
||||||
|
// on non-Windows (APPDATA unset).
|
||||||
func ClearAECrashState() {
|
func ClearAECrashState() {
|
||||||
appData := os.Getenv("APPDATA")
|
appData := os.Getenv("APPDATA")
|
||||||
if appData == "" {
|
if appData == "" {
|
||||||
return
|
return // non-Windows / dev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1. session crash-recovery files
|
||||||
base := filepath.Join(appData, "Adobe", "After Effects")
|
base := filepath.Join(appData, "Adobe", "After Effects")
|
||||||
entries, err := os.ReadDir(base)
|
if entries, err := os.ReadDir(base); err == nil {
|
||||||
if err != nil {
|
for _, e := range entries {
|
||||||
return
|
if e.IsDir() {
|
||||||
}
|
_ = os.Remove(filepath.Join(base, e.Name(), "SCRPriorState.json"))
|
||||||
for _, e := range entries {
|
}
|
||||||
if e.IsDir() {
|
|
||||||
_ = os.Remove(filepath.Join(base, e.Name(), "SCRPriorState.json"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. registry session/crash state
|
||||||
|
_ = exec.Command("reg", "delete", `HKCU\Software\Adobe\After Effects\AppStates`, "/f").Run()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user