Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Fallback to Windows 11 if version unknown #250

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/define.sh
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ fromName() {

case "${name,,}" in
*"windows 10"* ) id="win10${arch}" ;;
*"optimum 10"* ) id="win10${arch}" ;;
*"windows 11"* ) id="win11${arch}" ;;
*"optimum 11"* ) id="win11${arch}" ;;
esac

echo "$id"
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