Update install.sh

This commit is contained in:
Kroese 2024-01-29 04:17:07 +01:00 committed by GitHub
parent 15899d0453
commit 8792ea0489
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,8 +185,7 @@ abortInstall() {
startInstall() {
local magic desc
local msg="Windows is being started, please wait..."
html "Starting Windows..."
if [ -f "$STORAGE/$CUSTOM" ]; then
@ -207,36 +206,24 @@ startInstall() {
BASE="$VERSION.iso"
if ! skipInstall && [ ! -f "$STORAGE/$BASE" ]; then
desc=$(printVersion "$VERSION")
[ -z "$desc" ] && desc="Windows"
msg="Downloading $desc..."
fi
else
BASE=$(basename "${VERSION%%\?*}")
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g')
if ! skipInstall && [ ! -f "$STORAGE/$BASE" ]; then
msg="Downloading $BASE ..."
fi
fi
[[ "${BASE,,}" == "custom."* ]] && BASE="windows.iso"
fi
html "$msg"
[ -z "$MANUAL" ] && MANUAL="N"
if [ -f "$STORAGE/$BASE" ]; then
# Check if the ISO was already processed by our script
local magic=""
magic=$(dd if="$STORAGE/$BASE" seek=0 bs=1 count=1 status=none | tr -d '\000')
magic="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')"