refactor: use unattended windows installation by default

Create unattended windows installation iso by default when creating
windows vms with --create-config.
To disable, pass --disable-unattended

https://github.com/quickemu-project/quickemu/pull/1373/files#r1673481239

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
This commit is contained in:
Alpha 2024-07-12 01:46:41 +05:30 committed by Martin Wimpress
parent d3a95c2fe5
commit fc43f861b7
1 changed files with 11 additions and 13 deletions

View File

@ -3333,18 +3333,16 @@ function create_config() {
*windows-server*|*eval_oemret_x*|*eval_x*) CUSTOM_OS="windows-server";;
*windows*|win*)
CUSTOM_OS="windows"
while [ $# -gt 2 ]; do
case "${3}" in
-unattended|--unattended)
echo "Downloading VirtIO drivers..."
web_get "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" "${VM_PATH}"
FIXED_ISO=${VM_PATH}/virtio-win.iso
rm -f "${VM_PATH}/unattended.iso"
unattended_windows "${VM_PATH}"
shift
esac
done
# Older windows 10 ISOs use the year followed by the month rather than the year & half). Match any text for language.
if [ "${3}" != "--disable-unattended" ] && ( [ "${3}" == "--unattended" ] || grep -E -q 'Win(10|11)_([0-9]{2}H(1|2)|[0-9]{4})_[^.]*?(x64|x32)(v[0-9])?.iso' <<< "${INPUT}" ); then
echo "Creating unattended Windows installation files. To disable, pass --disable-unattended"
echo
echo "Downloading VirtIO drivers..."
web_get "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" "${VM_PATH}"
FIXED_ISO=${VM_PATH}/virtio-win.iso
rm -f "${VM_PATH}/unattended.iso"
unattended_windows "${VM_PATH}"
fi
;;
*) CUSTOM_OS="linux";;
@ -3397,7 +3395,7 @@ Arguments:
--help : Show this help message
------------------------------------ Flags -------------------------------------
--create-config:
--unattended : Unattended windows installation
--disable-unattended : Force quickget not to set up an unattended installation
-------------------------- For testing & development ---------------------------
--url [os] [release] [edition] : Show image URL(s)
--check [os] [release] [edition] : Check image URL(s)