How to prep a (reasonably) universal Bootcamp image

franton
Valued Contributor III

So after some favourable responses, i'm going to try and explain in a few words how to build a pretty universal bootcamp image. I discovered by accident that the bootcamp drivers out there for 64bit macs only vary in version number and not by much. Initial testing of all this is promising in that drivers for the latest iMac seem to work fine on my five+ year old iMac!

This is going to get pretty heavy. If you're not comfortable sysprep'ing Windows 7, creating unattend.xml files in Windows Automated Installation Kit then do not proceed!

First of all visit this website.http://www.cafe-encounter.net/p682/download-bootcamp-drivers. This guy has very handily found the download links for all the bootcamp installs. You'll need to download the 3rd December and the 15th June 2012 dmgs as they contain all the drivers you'll need.

Second, you'll need a way to uncompress the mass of .exe files contained in the packages. My personal favourite is The Unarchiver http://wakaba.c3.cx/s/apps/unarchiver.html.

You'll have to uncompress manually just about everything. You'll find that Apple likes to include a lot of unnecessary duplication of files in there, mainly txt files of licence information. That can safely go in the trash. I'm also assuming you're only going 64bit so all the non 64 stuff can also go in the trash too.

The driver package from the 3rd December should be decompressed in it's entirety. The other package is just for getting the drivers that are missing from the later versions. For example the Marvell, ATI and SigmaTel drivers.

What you should be left with after a LOT of work is 31 (!) separate folders from all your extraction efforts. Create two folders. Call one "BootcampINF" and the other "drivers".

You'll need to separate the folders that just contain driver .inf files from the ones that require a setup.exe to be run. You'll have to exercise your own judgement on this, there's really too much for me to list in this posting. Go slow and you shouldn't miss anything.

All the folders you have copies containing ONLY inf files (no installers) should go into the "BootcampINF" folder. Those folders should now be renamed so they're in sequential order.

The folders containing the drivers that require an .exe to install should be moved to the other folder.

With me so far? I hope so!

You'll need a Windows machine (yuk) next running Windows Automated Install Kit. Your task is now to create an unattend.xml file that does the rest of the hard work for you. You'll also need a Win 7 Enterprise install CD as the kit requires it for certain tasks. It's out of the scope of this document to instruct on the use of this kit. You're basically going to get the computer to silently install all the remaining drivers for you when the computer boots.

To give you an idea of what you should be aiming for, i'll copy+paste the relevant part of our .xml here. You can see there's a lot of switches being passed to installers. Pay special attention to the ATI graphics driver one! It's probably the most unfriendly unattended installer i've personally come across.

<FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>1</Order>
                    <CommandLine>cmd /c "c:	empdrivers1VCRedistvcredist_x86.exe /q"</CommandLine>
                    <Description>VC Redistribtion</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>2</Order>
                    <CommandLine>cmd /c "c:	empdrivers2ChipsetSetup.exe -s"</CommandLine>
                    <Description>Intel Chipset Driver Install</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>3</Order>
                    <CommandLine>cmd /c "c:	empdrivers3IntelHDGraphicsSetup64Setup.exe -s"</CommandLine>
                    <Description>Intel HD Graphics</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>4</Order>
                    <CommandLine>cmd /c "c:	empdrivers4IntelMgmtEngineSetup.exe -s"</CommandLine>
                    <Description>Intel Chipset Management Engine</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>5</Order>
                    <CommandLine>cmd /c "c:	empdrivers5IntelxHCISetupSetup.exe -s"</CommandLine>
                    <Description>Intel xHCI Setup</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>6</Order>
                    <CommandLine>cmd /c "c:	empdrivers6NVidiaChipset64setup.exe -s"</CommandLine>
                    <Description>NVidia Chipset Drivers</Description>
                </SynchronousCommand>
               <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>7</Order>
                    <CommandLine>cmd /c "c:	empdrivers7RealtekSetupsetup.exe -s"</CommandLine>
                    <Description>Realtek Audio Drivers</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>8</Order>
                    <CommandLine>cmd /c "c:	empdrivers8SigmaTelSetupsetup.exe -s"</CommandLine>
                    <Description>Realtek Audio Drivers</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>9</Order>
                    <CommandLine>cmd /c "c:	empdrivers9ATIGraphicsSetupsetup.exe /UNATTENDED_INSTALL /FORCE_HIDE_FIRST_RUN /AUTOACCEPT_ALL /FORCE_CLOSE_WHEN_DONE /ON_REBOOT_MESSAGE:NO"</CommandLine>
                    <Description>ATI Graphics Drivers</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>10</Order>
                    <CommandLine>cmd /c "c:	empdrivers10NV_Win7_64setup.exe -s"</CommandLine>
                    <Description>NVidia Graphics Drivers</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <RequiresUserInput>false</RequiresUserInput>
                    <Order>11</Order>
                    <CommandLine>wscript c:	empguirunonce.vbs</CommandLine>
                    <Description>Joins to AD</Description>
                </SynchronousCommand>
                <SynchronousCommand wcm:action="add">
                    <Description>Disable Administrator account</Description>
                    <Order>12</Order>
                    <CommandLine>cmd /c net user Administrator /active:no</CommandLine>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
        <SynchronousCommand wcm:action="add">
                    <Order>13</Order>
                    <CommandLine>c:	empSetupComplete.cmd</CommandLine>
                    <Description>Cleans up installation files</Description>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>

We have other vb scripts (double yuk) in our build that do AD binding. Again, this is sadly out of the scope of this article. I can't include ours mainly because they weren't written by me! However the last script in the .xml is just a simple batch file that does a lot of file cleaning up.

So the way we have things set up is as follows:

c: emp --- temp folder to contain drivers and other misc items.
c: empdrivers* --- this contains all the drivers that require a setup program to be run.

BootcampINF* --- folder that contains sequentially numbered folders with all the other drivers in.

unattend.xml --- file to do a lot of the work after sysprep.

So with all this on a USB stick, install Windows 7 on a Bootcamp partition. Copy the temp folder to the root of C drive. Copy the BootcampINF folder to c:Windowsinf and finally copy the unattend.xml file to c:windowssystem32sysprep .

You're now ready. Open up a command line and type the following:

cd 
cd windowssystem32sysprep
sysprep.exe /oobe /generalize /shutdown /unattend:C:windowssystem32sysprepunattend.xml

Be very careful before that last command! Before that point it's possible to double check your work. After you hit enter, the computer will sysprep itself and turn itself off.

You can now make an image of the bootcamp partition with Winclone Pro. Remember to carefully test this for errors and bugs before it goes live! I'm still testing our image so be careful!

I know this isn't the best guide in the world but hopefully it will help move you all in the right direction.

2 REPLIES 2

rob_potvin
Contributor III
Contributor III

Awesome thanks mate, great article

franton
Valued Contributor III

It's been a while since I wrote this. Since then i've discovered Tim Sutton's wonderful tool Brigadier https://github.com/timsutton/brigadier which will allow you strip out most of the above. You'll still have to include all the network drivers you can find in the Windows/inf folder.