From 85edbd79fea799e2456dc67b2242f83844a2fdb4 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 10 May 2024 02:11:49 +0200 Subject: [PATCH] Update install.sh --- src/install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/install.sh b/src/install.sh index 676d2b5..0b42b1d 100644 --- a/src/install.sh +++ b/src/install.sh @@ -894,8 +894,13 @@ updateImage() { xml=$(basename "$asset") info "Adding $xml for automatic installation..." - if ! wimlib-imagex extract "$loc" "$index" "/$file" "--dest-dir=$TMP" 2> /dev/null; then - warn "failed to extract answer file ($file) from ISO image.." + if wimlib-imagex extract "$loc" "$index" "/$file" "--dest-dir=$TMP" >/dev/null 2>&1; then + if [ -f "$TMP/$file" ] && isOurs "$TMP/$file"; then + info "Saving original..." + if ! wimlib-imagex update "$loc" "$index" --command "rename /$file /$file.org" > /dev/null; then + warn "failed to rename answer file ($file) in ISO image." + fi + fi fi if ! wimlib-imagex update "$loc" "$index" --command "add $asset /$file" > /dev/null; then