diff --git a/src/answer.sh b/src/answer.sh index 2f540b59..74409eb0 100644 --- a/src/answer.sh +++ b/src/answer.sh @@ -1644,6 +1644,43 @@ writeVBS() { return 0 } +disableAutoReboot() { + + local target="$1" + local file + + file=$(find \ + "$target" \ + -maxdepth 1 \ + -type f \ + -iname HIVESYS.INF \ + -print -quit + ) || return 1 + + if [ -z "$file" ]; then + error "The file HIVESYS.INF could not be found!" + return 1 + fi + + if grep -Fqi \ + 'HKLM,"SYSTEM\CurrentControlSet\Control\CrashControl","AutoReboot"' \ + "$file"; then + + sed -i -E \ + 's|^(HKLM,"SYSTEM\\CurrentControlSet\\Control\\CrashControl","AutoReboot",[^,]*,)[^[:space:]]*|\1 0|I' \ + "$file" || return 1 + + else + + printf '%s\n' \ + 'HKLM,"SYSTEM\CurrentControlSet\Control\CrashControl","AutoReboot",0x00010001,0' | + unix2dos >> "$file" || return 1 + + fi + + return 0 +} + legacyInstall() { local dir="$2" @@ -1683,6 +1720,10 @@ legacyInstall() { addLegacyDrivers "$dir" "$target" "$driver" "$arch" "$drivers" || return 1 fi + if [[ "${driver,,}" == "xp" ]] && enabled "$DEBUG"; then + disableLegacyAutoReboot "$target" || return 1 + fi + setLegacyKey "$target" "$driver" "$arch" "$desc" || return 1 validateProductKey "$KEY" || return 1 diff --git a/src/image.sh b/src/image.sh index d26948c2..914d8a4f 100644 --- a/src/image.sh +++ b/src/image.sh @@ -984,7 +984,7 @@ min_severity = warning show_summary = false [rules] -disabled_rules = W001,W025,W028,W33,W041,SEC002,SEC005 +disabled_rules = W001,W025,W028,W033,W041,SEC002,SEC005 EOC output=$(