mirror of
https://github.com/dockur/windows.git
synced 2026-07-07 05:07:26 +01:00
feat: Improve error handling during image detection (#1813)
This commit is contained in:
+11
-2
@@ -832,7 +832,11 @@ detectImage() {
|
|||||||
warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1
|
warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1
|
||||||
fi
|
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
|
checkPlatform "$info" || exit 67
|
||||||
|
|
||||||
DETECTED=$(detectVersion "$info")
|
DETECTED=$(detectVersion "$info")
|
||||||
@@ -1122,7 +1126,12 @@ updateImage() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
index="1"
|
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^^}" == *"<IMAGE INDEX=\"2\">"* ]]; then
|
if [[ "${result^^}" == *"<IMAGE INDEX=\"2\">"* ]]; then
|
||||||
index="2"
|
index="2"
|
||||||
|
|||||||
Reference in New Issue
Block a user