Thursday, February 7, 2008

Deploying Vista images to computers

This is the process I've found works best for deploying Vista and pre-installed apps to computers around our office. Most of the information was gotten from http://technet2.microsoft.com/WindowsVista/en/library/76932aa5-61a0-4d38-9a58-8e16a064ad141033.mspx?mfr=true or links on that page.

You need two computers for this process:

A technician computer (that will NOT get wiped out during this process - this is the computer you use to burn the disks and install the special software you need for this process)

and
A master computer (the one on which you set up Vista just the way you want it).


On the technician computer:

First, make a WinPE disk with the tool you'll need to image the master computer (this tool is called ImageX). WinPE means Windows Preinstallation Environment - it's basically a very small operating system that installs to memory only (temporary, and not on your hard drive) and can run special WinPE programs and console programs. ImageX is the tool that takes a snapshot of the hard drive partition and saves it in a file.

-Install WAIK (Windows Automated Installation Kit), downloadable for free from microsoft. The download is an .img file. You'll need a third-party software like Alex Feinman's free .iso powertoy, since an .img file is an image of a CD. When it's downloaded, rename the .img file to .iso, right click and choose to burn to CD. When it's done, put the CD in your computer and install the WAIK software.
-Open up Windows PE Tools Command Prompt from Start Menu
-At the command prompt, type: copype.cmd x86 c:\winpe_x86 and press enter
-This creates the structure you'll need at c:\winpe_x86 - primarily you just need the /iso/ subfolder...this is your source for the WinPE cd image you'll burn
-copy imagex.exe from your c:\program files\waik\tools\x86 into the c:\winpe_x86\iso folder.
-copy the servicing folder from c:\program files\waik\tools\x86 into the c:\winpe_x86\iso folder.
-At the command prompt, type copy c:\windows\system32\msxml6*.dll c:\winpe_x86\iso\servicing and press enter. It will copy probably two files into the servicing folder.
-Create an exclusion list for ImageX by copying and pasting the below lines into notepad, then save it as c:\winpe_x86\iso\wimscript.ini
[ExclusionList]
ntfs.log
hiberfil.sys
pagefile.sys
"System Volume Information"
RECYCLER
Windows\CSC
[CompressionExclusionList]

*.mp3
*.zip
*.cab
\WINDOWS\inf\
*.pnf
-Now, you need to write everything in the iso subfolder into an actual .iso file, so at the command prompt, run oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso
-burn the iso onto a CD by right-clicking the .iso file and choosing to burn it onto CD. Now you've got a bootable CD with all the tools you need on it to image a computer. Label this CD WinPE.

Now we can actually set up and image the master computer.

Do this on the master computer:

-Install Windows Vista like normal. Don't enter a key or activate the computer.
-Set up a user account, login and set up the computer just the way you want it. Install any updates you want, install any programs you want, set the homepage, screensaver, etc. You CAN install MS Office 2007, but don't enter your key or activate it. Don't activate any other programs that tie a single serial to a single computer - you'll still need to do this on each computer you install this image to.
-When it's all just the way you want all your users setup, run c:\windows\system32\sysprep\sysprep.exe /audit /restart
-The computer will restart
-When it restarts, you'll automatically be logged in as Administrator. You'll see a window open called sysprep. DO NOT close this window.
-You need to make the settings you created on the other user's account the default. To do this, click start, right-click computer, and choose Properties. Click the Advanced System Settings on the left. Click the advanced tab, then click Settings in the box labeled User Profiles.
-Highlight the user you created (NOT administrator), and then click the button labeled Copy To... In the Copy profile to box, type in C:\Users\Default, then click Change under "Permitted to use". Type in Everyone and click OK. Now click OK, and you'll see the progress of the user getting copied.
-Now highlight your setup user again and click the Delete button. Click OK on all the open windows to get back to the desktop (DON'T close the sysprep window).
-Now delete the user you created - you don't want this user account showing up on ALL the computers you install this image to. Use User Accounts in the Control Panel to do this.
-Run attrib c:\Users\Default +s +h to set the Default profile back to a hidden system file.
-Now the computer is ready to image. In the sysprep window, check the generalize box, then set the dropdowns to oobe and shutdown. Click OK, and your computer will shut down. It's now 'resealed' and legal to image.

-Now put in the WinPE CD, and restart the computer. It should boot into a command prompt with a Vista aura background.
-Switch to the CD drive (probably D:), then run imagex /compress fast /check /flags "Business" /scroll /capture c: c:\install.wim " My Vista" "Vista with all my programs", replacing "Business" " My Vista" and "Vista with all my programs" with your Vista edition, the name of your install, and a description of the image, respectively. You'll see it imaging the computer - it could take an hour or more.
-Now eject the CD and reboot the computer.
-You'll need to create a new user account to get back into Vista, unless you press Ctrl+Shift+F3 when it asks you for a user name, in which case you'll reboot into Administrator.
-Now you'll see a new file on your C: drive, called install.img. Copy this file to a DVD using Vista's DVD burner. Eject this disk and take it back to your technician computer.

Back on the Technician computer:

-Insert your actual retail Windows Vista DVD. Run xcopy c:\VistaFlat /s replacing with the drive the Vista disk is in. (Usually D:)
-Now you have a copy of the Vista installation disk on your c: at VistaFlat
-Eject the Vista DVD, and instead insert the DVD with install.img that you burned on the master computer.
-Copy install.img into C:\VistaFlat\sources. It will ask you if you want to overwrite the existing file, choose Yes.
-Now open the Windows PE Tools Command Prompt from the start menu, and run oscdimg -n -m -lMyVista -h -bc:\winpe_x86\etfsboot.com c:\VistaFlat c:\MyVista.iso (replacing MyVista with the label you want the DVD to have-two places).
-Now on your C: drive, you'll see a new .iso file (called whatever you replaced MyVista with). Right-click that file and burn it to DVD. Label that disc My Custom Vista Install.


-Now you can use that DVD to install your custom Vista and all your programs on any computer. You'll have to enter the key and activate it on each computer, but that's not a big deal, since you don't have to install ALL your programs manually! Note that you MUST have a key for the version of Vista that you imaged. You can't image Vista Ultimate and expect to install and activate it with a Business key.