diff --git a/src/define.sh b/src/define.sh index 65fa9d1..bd646c8 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1577,8 +1577,8 @@ prepareInstall() { [ -z "$WIDTH" ] && WIDTH="1280" [ -z "$HEIGHT" ] && HEIGHT="720" - XHEX=$(printf '%x\n' "$WIDTH") - YHEX=$(printf '%x\n' "$HEIGHT") + XHEX=$(printf '%08x\n' "$WIDTH") + YHEX=$(printf '%08x\n' "$HEIGHT") local username="" local password="" @@ -1697,13 +1697,13 @@ prepareInstall() { echo "" echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]" echo "\"DefaultSettings.BitsPerPel\"=dword:00000020" - echo "\"DefaultSettings.XResolution\"=dword:00000$XHEX" - echo "\"DefaultSettings.YResolution\"=dword:00000$YHEX" + echo "\"DefaultSettings.XResolution\"=dword:$XHEX" + echo "\"DefaultSettings.YResolution\"=dword:$YHEX" echo "" echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Control\VIDEO\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]" echo "\"DefaultSettings.BitsPerPel\"=dword:00000020" - echo "\"DefaultSettings.XResolution\"=dword:00000$XHEX" - echo "\"DefaultSettings.YResolution\"=dword:00000$YHEX" + echo "\"DefaultSettings.XResolution\"=dword:$XHEX" + echo "\"DefaultSettings.YResolution\"=dword:$YHEX" echo "" echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]" echo "\"ScreenSaver\"=\"reg add \\\"HKCU\\\\Control Panel\\\\Desktop\\\" /f /v \\\"SCRNSAVE.EXE\\\" /t REG_SZ /d \\\"off\\\"\"" diff --git a/src/install.sh b/src/install.sh index b52a6e1..c754d7a 100644 --- a/src/install.sh +++ b/src/install.sh @@ -37,8 +37,6 @@ backup () { dir="$root/$folder" done - rm -rf "$dir" - if ! makeDir "$dir"; then error "Failed to create directory \"$dir\" !" return 1 @@ -110,7 +108,7 @@ skipInstall() { [ ! -s "$iso" ] && return 1 # Check if the ISO was already processed by our script - magic=$(dd if="$iso" seek=0 bs=1 count=1 status=none | tr -d '\000') + magic=$(dd if="$iso" bs=1 count=1 status=none | tr -d '\000') magic="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')" byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17" @@ -164,7 +162,7 @@ startInstall() { fi if ! makeDir "$TMP"; then - error "Failed to create directory \"$TMP\" !" + error "Failed to create directory \"$TMP\" !" && exit 50 fi if [ -z "$CUSTOM" ]; then @@ -1180,7 +1178,7 @@ buildImage() { error "Failed to locate file \"$ETFS\" in ISO image!" && return 1 fi - size=$(du -h -b --max-depth=0 "$dir" | cut -f1) + size=$(du -b --max-depth=0 "$dir" | cut -f1) size_gb=$(formatBytes "$size") space=$(df --output=avail -B 1 "$TMP" | tail -n 1) space_gb=$(formatBytes "$space") diff --git a/src/mido.sh b/src/mido.sh index c13048c..45d7768 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -63,18 +63,12 @@ download_windows() { local id="$1" local lang="$2" local desc="$3" - local sku_id="" - local sku_url="" - local iso_url="" - local iso_json="" - local language="" - local session_id="" - local user_agent="" - local download_type="" - local windows_version="" - local iso_download_link="" - local download_page_html="" - local product_edition_id="" + local ovw="" rtick="" sku_id="" sku_url="" + local iso_url="" iso_json="" language="" org_id="" + local instance_id="" vls_url="" ov_url="" ov_data="" + local session_id="" user_agent="" download_type="" + local windows_version="" iso_download_link="" + local download_page_html="" product_edition_id="" local language_skuid_json="" local profile="606624d44113" @@ -229,13 +223,8 @@ download_windows_eval() { local id="$1" local lang="$2" local desc="$3" - local filter="" - local culture="" - local compare="" - local language="" - local user_agent="" - local enterprise_type="" - local windows_version="" + local filter="" culture="" compare="" language="" + local user_agent="" enterprise_type="" windows_version="" case "${id,,}" in "win11${PLATFORM,,}-enterprise-eval" ) @@ -273,6 +262,7 @@ download_windows_eval() { culture=$(getLanguage "$lang" "culture") local country="${culture#*-}" + local iso_download_link="" local iso_download_links="" local iso_download_page_html="" local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version" @@ -512,12 +502,8 @@ getESD() { local version="$2" local lang="$3" local desc="$4" - local file - local result - local culture - local language - local edition - local catalog + local file result culture + local language edition catalog file=$(getCatalog "$version" "file") catalog=$(getCatalog "$version" "url")