Skip to content

Commit

Permalink
wizard: disable mounting guest tools for < Windows 10
Browse files Browse the repository at this point in the history
The Autounattend.xml file only applies to Windows 10. Older operating systems
should manually mount and install the tools after first boot.

Resolves #4440
  • Loading branch information
osy committed Sep 24, 2022
1 parent a8389da commit 5d62502
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
31 changes: 23 additions & 8 deletions Platform/Shared/VMWizardOSWindowsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,23 @@ struct VMWizardOSWindowsView: View {
#endif
List {
Section {
Toggle("Import VHDX Image", isOn: $useVhdx)
if useVhdx {
Link("Download Windows 11 for ARM64 Preview VHDX", destination: URL(string: "https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewARM64")!)
} else {
Link("Generate Windows Installer ISO", destination: URL(string: "https://uupdump.net/")!)
Toggle("Install Windows 10 or higher", isOn: $wizardState.isWindows10OrHigher)
.onChange(of: wizardState.isWindows10OrHigher) { newValue in
if newValue {
wizardState.systemBootUefi = true
wizardState.isGuestToolsInstallRequested = true
} else {
wizardState.isGuestToolsInstallRequested = false
}
}

if wizardState.isWindows10OrHigher {
Toggle("Import VHDX Image", isOn: $useVhdx)
if useVhdx {
Link("Download Windows 11 for ARM64 Preview VHDX", destination: URL(string: "https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewARM64")!)
} else {
Link("Generate Windows Installer ISO", destination: URL(string: "https://uupdump.net/")!)
}
}
} header: {
Text("Image File Type")
Expand Down Expand Up @@ -66,12 +78,15 @@ struct VMWizardOSWindowsView: View {
}
}

DetailedSection("", description: "Some older systems do not support UEFI boot, such as Windows 7 and below.") {
Toggle("UEFI Boot", isOn: $wizardState.systemBootUefi)
if !wizardState.isWindows10OrHigher {
DetailedSection("", description: "Some older systems do not support UEFI boot, such as Windows 7 and below.") {
Toggle("UEFI Boot", isOn: $wizardState.systemBootUefi)
}
}

// Disabled on iOS 14 due to a SwiftUI layout bug
if #available(iOS 15, *) {
// Disabled for non-Windows 10 installs due to autounattend version
if #available(iOS 15, *), wizardState.isWindows10OrHigher {
DetailedSection("", description: "Download and mount the guest support package for Windows. This is required for some features including dynamic resolution and clipboard sharing.") {
Toggle("Install drivers and SPICE tools", isOn: $wizardState.isGuestToolsInstallRequested)
}
Expand Down
1 change: 1 addition & 0 deletions Platform/Shared/VMWizardState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ enum VMWizardOS: String, Identifiable {
@Published var linuxBootArguments: String = ""
@Published var linuxHasRosetta: Bool = false
@Published var windowsBootVhdx: URL?
@Published var isWindows10OrHigher: Bool = true
@Published var systemArchitecture: QEMUArchitecture = .x86_64
@Published var systemTarget: any QEMUTarget = QEMUTarget_x86_64.default
#if os(macOS)
Expand Down

0 comments on commit 5d62502

Please sign in to comment.