[gnome-boxes] winxp: Copy drivers from the extra install ISO



commit a30dcd6e0e12ecb762918d9f62f21401413920fc
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Apr 23 20:09:22 2012 +0200

    winxp: Copy drivers from the extra install ISO
    
    Boxes optionally supports using an additional ISO image with
    extra drivers to install to get better integration after the
    installation. However, Windows XP (contrary to Windows 7) is not
    able to read drivers directly from the CD but needs them to be
    copied to the unattended floppy image.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679752

 src/winxp-installer.vala |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/src/winxp-installer.vala b/src/winxp-installer.vala
index da5bc1d..8f4e2db 100644
--- a/src/winxp-installer.vala
+++ b/src/winxp-installer.vala
@@ -51,6 +51,32 @@ private class Boxes.WinXPInstaller: WindowsInstaller {
         extra_iso = "win-tools.iso";
     }
 
+    public override async void prepare_for_installation (string vm_name, Cancellable? cancellable) throws GLib.Error {
+        yield base.prepare_for_installation (vm_name, cancellable);
+
+        if (extra_iso == null)
+            return;
+
+        ISOExtractor extractor = new ISOExtractor (extra_iso);
+
+        yield extractor.mount_media (cancellable);
+
+        string driver_path = (os_media.architecture == "x86_64")?"preinst/winxp/amd64":"preinst/winxp/x86";
+
+        GLib.FileEnumerator enumerator = yield extractor.enumerate_children (driver_path, cancellable);
+        GLib.List<FileInfo> infos = yield enumerator.next_files_async (4, GLib.Priority.DEFAULT, cancellable);
+        while (infos != null) {
+            foreach (var info in infos) {
+                string relative_path = Path.build_filename (driver_path, info.get_name ());
+                string full_path = extractor.get_absolute_path (relative_path);
+                var unattended_file = new UnattendedRawFile (this, full_path, info.get_name ());
+                debug ("Copying %s from extra ISO to unattended floppy", relative_path);
+                yield unattended_file.copy (cancellable);
+            }
+            infos = yield enumerator.next_files_async (4, GLib.Priority.DEFAULT, cancellable);
+        }
+    }
+
     protected override void setup_ui () {
         base.setup_ui ();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]