Skip to content

Commit

Permalink
feat: Fallback to Windows 11 if version unknown (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Feb 17, 2025
1 parent e6d7495 commit 61d7e0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/define.sh
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,9 @@ fromName() {
*"windows 7"* ) id="win7${arch}" ;;
*"windows 8"* ) id="win81${arch}" ;;
*"windows 10"* ) id="win10${arch}" ;;
*"optimum 10"* ) id="win10${arch}" ;;
*"windows 11"* ) id="win11${arch}" ;;
*"optimum 11"* ) id="win11${arch}" ;;
*"windows vista"* ) id="winvista${arch}" ;;
*"server 2025"* ) id="win2025${add}" ;;
*"server 2022"* ) id="win2022${add}" ;;
Expand Down
13 changes: 12 additions & 1 deletion src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,13 @@ addDriver() {
local path="$2"
local target="$3"
local driver="$4"
local desc=""
local folder=""

if [ -z "$id" ]; then
warn "no Windows version specified for \"$driver\" driver!" && return 0
fi

case "${id,,}" in
"win7x86"* ) folder="w7/x86" ;;
"win7x64"* ) folder="w7/amd64" ;;
Expand All @@ -701,7 +706,8 @@ addDriver() {
esac

if [ -z "$folder" ]; then
warn "no \"$driver\" driver found for \"$DETECTED\" !" && return 0
desc=$(printVersion "$id" "$id")
warn "no \"$driver\" driver available for \"$desc\" !" && return 0
fi

[ ! -d "$path/$driver/$folder" ] && return 0
Expand Down Expand Up @@ -734,6 +740,11 @@ addDrivers() {
local msg="Adding drivers to image..."
info "$msg" && html "$msg"

if [ -z "$version" ]; then
version="win11x64"
warn "Windows version unknown, falling back to Windows 11 drivers..."
fi

if ! bsdtar -xf /drivers.txz -C "$drivers"; then
error "Failed to extract drivers from archive!" && return 1
fi
Expand Down

0 comments on commit 61d7e0d

Please sign in to comment.