From 154108830e528c592e3a9c76786d0d851d878dbd Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 20 Apr 2025 19:08:50 +0200 Subject: [PATCH] Update define.sh --- src/define.sh | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/define.sh b/src/define.sh index dbd7766..9aed1e2 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1380,7 +1380,8 @@ prepareInstall() { fi - local pid file setup + local pid="" + local file setup setup=$(find "$target" -maxdepth 1 -type f -iname setupp.ini -print -quit) if [ -n "$setup" ]; then @@ -1436,35 +1437,33 @@ prepareInstall() { local ip="20.20.20.1" [ -n "${VM_NET_IP:-}" ] && ip="${VM_NET_IP%.*}.1" - # These are not pirated keys, they come from the official MS documentation. - case "${driver,,}" in - "xp" ) + if [ -z "$KEY" ] && [[ "$pid" != *"270" ]]; then - if [[ "${arch,,}" == "x86" ]]; then - # Windows XP Professional x86 generic key (no activation, trial-only) - [ -z "$KEY" ] && KEY="DR8GV-C8V6J-BYXHG-7PYJR-DB66Y" - else - # Windows XP Professional x64 generic key (no activation, trial-only) - [ -z "$KEY" ] && KEY="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G" - fi ;; + # These are not pirated keys, they come from the official MS documentation. + case "${driver,,}" in + "xp" ) - "2k3" ) + if [[ "${arch,,}" == "x86" ]]; then + # Windows XP Professional x86 generic key (no activation, trial-only) + KEY="DR8GV-C8V6J-BYXHG-7PYJR-DB66Y" + else + # Windows XP Professional x64 generic key (no activation, trial-only) + KEY="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G" + fi ;; - if [[ "${arch,,}" == "x86" ]]; then - # Windows Server 2003 Standard x86 generic key (no activation, trial-only) - [ -z "$KEY" ] && KEY="QKDCQ-TP2JM-G4MDG-VR6F2-P9C48" - else - # Windows Server 2003 Standard x64 generic key (no activation, trial-only) - [ -z "$KEY" ] && KEY="P4WJG-WK3W7-3HM8W-RWHCK-8JTRY" - fi ;; + "2k3" ) - "2k" ) + if [[ "${arch,,}" == "x86" ]]; then + # Windows Server 2003 Standard x86 generic key (no activation, trial-only) + KEY="QKDCQ-TP2JM-G4MDG-VR6F2-P9C48" + else + # Windows Server 2003 Standard x64 generic key (no activation, trial-only) + KEY="P4WJG-WK3W7-3HM8W-RWHCK-8JTRY" + fi ;; - KEY="" ;; + esac - * ) error "Unknown version: \"$driver\"" && return 1 ;; - - esac + fi [ -n "$KEY" ] && KEY="ProductID=$KEY"