From db26ed4728605188020b16189f830768c3339cf5 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 20 Apr 2025 18:51:12 +0200 Subject: [PATCH] Update define.sh --- src/define.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/define.sh b/src/define.sh index 9a8c955..1182eb8 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1386,21 +1386,26 @@ prepareInstall() { if [ -n "$setup" ]; then pid=$(<"$setup") + pid="${pid%$'\r'}" + + case "$pid" in + *"000" | *"270" | *"OEM" ) ;; + * ) warn "unknown PID: ${pid:(-3)}" ;; + esac if [[ "$driver" == "2k" ]]; then - echo "${pid:0:$((${#pid})) - 4}270" > "$setup" + echo "${pid:0:$((${#pid})) - 3}270" > "$setup" else - pid="${pid:(-4)}" - - if [[ "${pid:0:3}" == "270" ]]; then + if [[ "$pid" != *"270" ]]; then + echo "${pid:0:$((${#pid})) - 3}000" > "$setup" + else warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation." fi fi - fi mkdir -p "$dir/\$OEM\$"