From 8ad66b62a80e6efe04435e730654fbeab8ddb417 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 7 Jul 2026 01:30:10 +0200 Subject: [PATCH] feat: Improve error handling during image detection (#1813) --- src/install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/install.sh b/src/install.sh index 5aed2fd..b069ba6 100644 --- a/src/install.sh +++ b/src/install.sh @@ -832,7 +832,11 @@ detectImage() { warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1 fi - info=$(wimlib-imagex info -xml "$wim" | iconv -f UTF-16LE -t UTF-8) + if ! info=$(wimlib-imagex info -xml "$wim" | iconv -f UTF-16LE -t UTF-8); then + warn "failed to read Windows image information, $FB" + return 1 + fi + checkPlatform "$info" || exit 67 DETECTED=$(detectVersion "$info") @@ -1122,7 +1126,12 @@ updateImage() { fi index="1" - result=$(wimlib-imagex info -xml "$wim" | iconv -f UTF-16LE -t UTF-8) + + if ! result=$(wimlib-imagex info -xml "$wim" | iconv -f UTF-16LE -t UTF-8); then + warn "failed to read boot image information, $FB" + MANUAL="Y" + result="" + fi if [[ "${result^^}" == *""* ]]; then index="2"