From 1cef71d26566ae914f097718325e600dae14d2e1 Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 6 Aug 2026 14:52:39 +0200 Subject: [PATCH] fix: Remove obsolete rebuilt custom ISOs (#2077) --- src/install.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/install.sh b/src/install.sh index 602aa4e2..c8b05835 100644 --- a/src/install.sh +++ b/src/install.sh @@ -419,8 +419,8 @@ skipInstall() { if [ -n "$previousBase" ]; then - # Older releases stored the original download name in windows.base. New - # releases always store the final ISO name, so migrate legacy state once. + # Older releases stored the original download name in windows.base. Current + # releases store an ISO source identity, so migrate legacy state once. if [[ "${previousBase,,}" != *.iso ]]; then if isCompressed "$previousBase" || [[ "${previousBase,,}" == *.esd ]]; then @@ -437,6 +437,15 @@ skipInstall() { fi + # Older releases may have left a rebuilt custom ISO at its synthetic source + # identity. A completed installation no longer needs that installation media. + if [[ "${previousBase,,}" == "windows."* ]] && [ -f "$boot" ] && hasData; then + if ! rm -f -- "$STORAGE/$previousBase"; then + error "Failed to remove obsolete ISO file \"$STORAGE/$previousBase\" !" + exit 50 + fi + fi + # A changed source invalidates an unfinished installation. Back up an # existing installation, but discard stale media when no disk exists yet. if [[ "${STORAGE,,}/${previousBase,,}" != "${iso,,}" ]]; then @@ -590,7 +599,7 @@ findFile() { ISO="$file" CUSTOM="$file" - # Include the custom ISO size in its persistent name so replacing a + # Encode the custom ISO size in a synthetic source identity so replacing a # bind-mounted ISO is detected as a different installation source. BOOT="$STORAGE/windows.$size.iso"