From 589f2c9a5c3aa8517c7dbc7224b1e42ea9a7b0b9 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sun, 30 Jun 2024 11:55:48 +0100 Subject: [PATCH] refactor: attempt to press any key 5 times during Window boot from CD/DVD --- quickemu | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/quickemu b/quickemu index 817974e..8a17127 100755 --- a/quickemu +++ b/quickemu @@ -2118,16 +2118,15 @@ fi if [ -z "${VM_PID}" ]; then vm_boot - # If the VM being started is an uninstalled Windows VM then auto-skip the press-any key prompt. - if [ -n "${iso}" ] && [ "${guest_os}" == "windows" ]; then - sleep 3.5 - monitor_send_cmd "sendkey ret" - fi - if [ -n "${iso}" ] && [ "${guest_os}" == "windows-server" ]; then - sleep 7 - monitor_send_cmd "sendkey ret" - fi start_viewer + # If the VM being started is an uninstalled Windows VM then auto-skip the press-any key prompt. + if [ -n "${iso}" ] && [[ "${guest_os}" == "windows"* ]]; then + # shellcheck disable=SC2034 + for LOOP in {1..5}; do + sleep 1 + monitor_send_cmd "sendkey ret" + done + fi else echo "${VMNAME}" echo " - Process: Already running ${VM} as ${VMNAME} (${VM_PID})"