feat: Improve Windows media detection and selection (#1946)

This commit is contained in:
Kroese
2026-07-24 16:52:14 +02:00
committed by GitHub
parent 99ac4035c7
commit c739e41e7e
6 changed files with 1025 additions and 256 deletions
+5 -17
View File
@@ -1013,23 +1013,7 @@ updateImage() {
return 1
fi
local fallback="/run/assets/${DETECTED%%-*}.xml"
if [[ "$DETECTED" != win20* &&
"$asset" == "$fallback" &&
"$asset" != "/run/assets/$DETECTED.xml" ]]; then
if ! sed -i \
-e '/<InstallFrom>.*<\/InstallFrom>/d' \
-e '/<ProductKey>.*<\/ProductKey>/d' \
-e '/<InstallFrom>/,/<\/InstallFrom>/d' \
-e '/<ProductKey>/,/<\/ProductKey>/d' \
"$answer"; then
error "Failed to make answer file edition-neutral: $answer"
return 1
fi
fi
removeGeneratedXML "$asset" || return 1
if [ -n "${CUSTOM_XML:-}" ]; then
@@ -1058,6 +1042,8 @@ updateImage() {
if enabled "$MANUAL"; then
removeGeneratedXML "$asset" || return 1
wimlib-imagex update "$wim" "$idx" --command "delete --force /$xml" > /dev/null || true
if wimlib-imagex extract "$wim" "$idx" "/$bak" "--dest-dir=$tmp" >/dev/null 2>&1; then
@@ -1204,6 +1190,8 @@ bootWindows() {
! parseLanguage && exit 56
! detectCustom && exit 59
testImages
if ! startInstall; then
bootWindows && return 0
exit 68