mirror of
https://github.com/dockur/windows.git
synced 2026-07-28 21:53:34 +07:00
Update install.sh
This commit is contained in:
+53
-3
@@ -599,6 +599,49 @@ extractESD() {
|
||||
return 1
|
||||
}
|
||||
|
||||
extractModernImage() {
|
||||
|
||||
local iso="$1"
|
||||
local dir="$2"
|
||||
|
||||
if ! rm -rf -- "$dir"; then
|
||||
error "Failed to remove directory \"$dir\" !"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! makeDir "$dir"; then
|
||||
error "Failed to create directory \"$dir\" !"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! 7z x "$iso" \
|
||||
-o"$dir" \
|
||||
-ir!"sources/boot.wim" \
|
||||
-ir!"boot/etfsboot.com" \
|
||||
-ir!"efi/microsoft/boot/efisys_noprompt.bin" \
|
||||
> /dev/null; then
|
||||
error "Failed to extract required files from ISO: $iso"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$dir/sources/boot.wim" ]; then
|
||||
error "Failed to extract sources/boot.wim from ISO!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$dir/boot/etfsboot.com" ]; then
|
||||
error "Failed to extract boot/etfsboot.com from ISO!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$dir/efi/microsoft/boot/efisys_noprompt.bin" ]; then
|
||||
error "Failed to extract EFI boot image from ISO!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
extractImage() {
|
||||
|
||||
local iso="$1"
|
||||
@@ -1333,9 +1376,16 @@ fi
|
||||
|
||||
DIR="$TMP/unpack"
|
||||
|
||||
if ! extractImage "$ISO" "$DIR" "$VERSION"; then
|
||||
rm -f "$ISO" 2> /dev/null || true
|
||||
exit 62
|
||||
if enabled "${ISO_TEST:-}"; then
|
||||
if ! extractModernImage "$ISO" "$DIR" "$VERSION"; then
|
||||
rm -f "$ISO" 2> /dev/null || true
|
||||
exit 62
|
||||
fi
|
||||
else
|
||||
if ! extractImage "$ISO" "$DIR" "$VERSION"; then
|
||||
rm -f "$ISO" 2> /dev/null || true
|
||||
exit 62
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! detectImage "$DIR" "$VERSION"; then
|
||||
|
||||
Reference in New Issue
Block a user