Making the Ultimate All-In-One Installation Flash Drive

December 22, 2011 by . 3 comments

Super Users often find ourselves installing operating systems. Whether you run your own computer shop, manage an army of thousands of corporate workstations, or are just the tech-savvy friend everyone you know calls for help, you’ve probably had to install various flavors of Windows over and over again. Most of us have also spent a fair amount of time installing different Linux distros, running data recovery disks, and using various live CDs.

The problem that presents itself is managing all of the required disks. There are at least 6 common flavors of Windows 7 alone (Home Premium, Professional, and Ultimate for both x86 and x64, plus Enterprise for you corporate types). Add in various distros of Linux and you start to see why some computer techs carry around whole folders of CDs.

I’ve been aware of Pendrive Linux for a while, which lets you setup a flash drive with multiboot Linux software, and can add a single Windows installation. But what if you wanted to have a single flash drive with all versions of Windows 7, as well as all the standard Linux boot disks? It took some work, but I decided to do this and the final result is impressive.

Getting ready

The first thing I did was got all my disk images readied. If you have access to TechNet, MSDN, or MSDNAA downloads, then this will be easy. If not, you’ll have to already own installation disks, or else get creative. You’ll need a Windows 7 x86 (32-bit) installation disk or ISO, and an x64 (64-bit) one. The edition doesn’t matter; in the process we’ll configure the installer to work for any version.

Download and install WinAIO Maker Professional, which will make the process of integrating your x64 and x86 disks a lot easier.

You’ll also need to install the Windows Automated Installation Kit (WAIK), which is available for free from Microsoft.

If you have an SSD or lots (more than 8GB) of RAM, you’ll do yourself a favor by putting as much of the working folders as possible on the SSD or in a RAMdisk. Temporarily disable your virus scanner’s realtime protection as well – extracting, decompressing, and repacking Windows installation images involves moving around a lot of tiny files at once, which is slowed down immensely by realtime scanners. Just don’t forget to turn it back on when you’re done!

Integrating x64 and x86 disks

This part is pretty easy – the WinAIO Maker software will do it all for you. Open up the main program, and select “AutoAIO”.

AutoAIO Settings

Choose a working directory, which it will extract the ISOs to and then use to make manipulations to them. If you have enough RAM, create a 5GB or larger RAMdisk and use it as your working directory. If you have even more RAM to spare, then put the ISOs in the RAMdisk as well. With 24 GB in my desktop machine, I was able to create a 16GB RAMdisk and do all of the work in there, but most computers won’t be able to afford that much space.

The AutoAIO software will create an ISO with both x64 and x86 installers integrated. You can use this ISO for all of the following steps.

Slipstreaming Internet Explorer 9

If you like your installation disk to start you off with all the latest, you’ll want to add IE9 to your all-in-one disk. This process is a bit convoluted, especially since you have to slipstream it for each version of Windows 7 that you are including on your disk.

I already wrote a detailed walk-through on how to integrate IE9 with your Windows 7 disk. If you’re doing it as just one step in creating the ultimate all-in-one installer though, you should do a few things differently.

Extract the contents of your all-in-one ISO to a working directory (preferably on your SSD or RAMdisk if you have either). Follow the instructions in the linked article on integrating IE9, from steps 3-10. At this point, you don’t want to recreate your ISO yet, as we still need to integrate drivers and modify the bootloader. You can also download a Windows batch file from my website to automate the slipstreaming process.

Adding Drivers

There’s also a Super User post on integrating drivers already. To summarize:

First, find files for all of the drivers you want to integrate with your installation disk. A lot of drivers are provided out of the box in Windows 7, but if you often work with particular models of computers that are picky about drivers, this can be quite handy, especially for things like laptop function keys, wireless drivers, quirky switchable graphics drivers, and just about anything related to Boot Camp (Windows on a Mac).

Drivers packaged as an exe installer need to be extracted first so that you can find the inf files which define the driver. If the driver is packaged as an exe, you can use a tool like 7zip to extract the files.

If you put all of your extracted drivers into a single folder, you can integrate all of them by using the /recurse flag on the dism tool (as explained in the linked answer).

Drivers need to be integrated for each version of Windows you are planning to use on your install disk, so again, you may need to repeat the process.

Recompressing the WIM

Once you’ve made all these changes to the WIM file, you may want to recompress it to fit your installation onto a DVD or flash drive. By default, WIMs are not recompressed when you make changes to them. To recompress your WIM, you need to export each individual image to a new file. Use the following command for each image, where X is the number of the image:

 ImageX.exe /export existing.wim X new.wim
The new WIM file can then be copied back to the original location.

Adding additional PE images

This is an advanced step that most people won’t care about, but if you’re the type to use various PE rescue disks, you can add those to the disk as well. The process for adding a second (or third) PE image to the disk is fairly simple. I got the instructions from The Cluberti Blog here. I added the MSDaRT Emergency Rescue Disk, both x86 and x64 versions, to my installation disk. This package is only available to Software Assurance customers and MSDN/TechNet subscribers, but if you aren’t able to access it, you can build your own Win7 RescuePE disk using WinBuilder.

The first step is to extract to a working directory the ISO of the image you’d like to add. Select everything in the extracted folder, go over to the working directory for your all-in-one disk, and paste in the copied contents of the other disk. The copy prompt will ask if you’re sure you want to merge folders; tell it yes. Make sure to tell it not to overwrite any files though. You only want to add files not present on the original disk.

Now go back to your extracted PE image, and find the boot.wim file in the sources folder. Rename it to something new – for example, msdart.wim or win7rescue.wim. Now copy it over to the sources folder in the all-in-one disk’s working folder.

You’ll now need to add the new boot image to the disk’s bootloader menu. If you’ve ever configured a dual-boot system you might be familiar with bcdedit. As it turns out, you can use it to modify an installation CD’s boot menu as well.

Open an elevated command prompt, and navigate to the boot directory in your all-in-one CD’s working folder. There should be a file called bcd in this folder, you can run dir bcd to check if it exists.

Run the following command to view the current boot setup:

bcdedit /store bcd /enum
Copy the default GUID into a notepad, as you’ll need it soon. Now, create a new entry:
bcdedit /store bcd /copy {default} /d "boot menu item name"
This will create a new item in the boot menu with the name you specify. For example, you might name it “Diagnostics and Recovery” or “Windows 7 Rescue Disk”. Copy the GUID of the new boot entry to a notepad as well. Now add a device for the new boot entry:
bcdedit /store bcd /set {GUID of new entry} DEVICE ramdisk=[boot]\<path to new .wim>,{GUID of default entry}
Now you need to repeat the above command using osdevice instead of device:
bcdedit /store bcd /set {GUID of new entry} OSDEVICE ramdisk=[boot]\<path to new .wim>,{GUID of default entry}
Your new image should now be added. To double-check, you can run this command again to verify that it’s been successfully added: bcdedit /store bcd /enum<strong>.

Putting it all together

Once you’ve added everything to your WIM image and recompressed it, copy it back into the folder with the rest of the installation DVD files, and recreate the ISO. Use the following command line:

oscdimg –b"folder_with_extracted_iso/boot/etfsboot.com" –h –u2 –m -lDiskName "folder_with_extracted_iso/" "path_to_desired_saved_install_image.iso" 
Before burning your DVD and using up a disk, use a virtual machine to make sure it works. You can then burn it to a DVD like you would with any ISO, or you can put the installation files on a flash drive using the Microsoft Windows Flash Drive Download Tool.

Adding Linux multiboot

If you want to go the extra mile and add other boot tools to your flash drive, download a copy of Pendrive Linux. I recommend the Your Universal Multiboot Installer – it’s a lot easier to use and simpler to manage than their newer Universal USB Installer. The installer will ask you which images you want to add to the flash drive. It has a comprehensive list of most common Live CD’s and installers for various Linux distros, rescue CDs, toolkits, and more. Some examples include BartPE, Clonezilla, Gparted, Ubuntu, Debian, UBCD, and Backtrack. For some of them the tool can automatically download the latest ISO for you, for others you’ll need to download it yourself. When adding Windows, choose the ISO you made in the previous steps, and it’ll integrate it with the flash drive for you. Congratulations! You now have every OS installer and live boot tool you’ll ever need, all on one flash drive.

3 Comments

Subscribe to comments with RSS.

  • surfasb says:

    Epic. I’ve done something similar but the instructions weren’t ever in a concise blog post.

  • Searock says:

    You might want to have a look at RMPrepUSB (http://www.rmprepusb.com) for creating multiboot usb drive

  • Raystafarian says:

    Very cool, and a good read.

  • Comments have been closed for this post