Fix install.wim existance check and extraction for Windows 7

Three bugs:
* Bash [ -a ] and [ ! -a ] are two different operations: the first checks for file existance, the second is a binary AND operation. Replace it with -e, which is consistent.
* Mount ISO before checking its contents
* Ensure that we extract the latest version of the wim/esd file (7z always replace)

Fixes #35
This commit is contained in:
ValdikSS 2022-12-08 22:12:37 +03:00
parent 964443265f
commit 4abb52133f

View File

@ -174,11 +174,11 @@ function extract_bootmgfw_from_installwim() {
# $2 - isomountpath # $2 - isomountpath
# $3 - destdir # $3 - destdir
local fpath="$2/sources/install.wim"
[ ! -a "$fpath" ] && fpath="$2/sources/install.esd"
mount -o ro "$1" "$2" mount -o ro "$1" "$2"
7z e "$fpath" -o"$3/efi/boot/" '?/Windows/Boot/EFI/bootmgfw.efi' local fpath="$2/sources/install.wim"
[ ! -e "$fpath" ] && fpath="$2/sources/install.esd"
7z e "$fpath" -aoa -o"$3/efi/boot/" '?/Windows/Boot/EFI/bootmgfw.efi'
umount "$2" umount "$2"
} }