With the recent release of Microsoft Windows XP Service Pack 3, Altiris administrators might be taking this opportunity to build a new base image for their environment. There are dozens of ways to build this base image and with more than a dozen documents circulating in the Altiris community related to creating Hardware Independent Images it can be frustrating to find all the information necessary in one document. The purpose of this document is to provide a step-by-step process that walks through every step necessary to build a Hardware Independent Image.
Windows XP Pro SP3 Image Build Process
- Pick a reference machine to use as your build system. Ideally this would be a machine that is old enough that every driver for all of the hardware is included on the Windows XP Pro SP3 CD. If this is not an option, pick the slowest machine you have available.
- Do not install any drivers onto the machine as part of the OS build.
- Do not have any external devices plugged into the computer such as Scanners, Printers, USB Devices, etc.
-
Boot the reference machine from a "Microsoft Windows XP Pro with SP3" Select CD and install the operating system. During the Windows Setup process follow these guidelines:
- During the initial XP Setup, press the F5 key when Setup asks you to press F6 for adding mass storage drivers. The installation will let you know it was unable to detect the type of computer and will present you with a list of options. This is where you specify the HAL to be installed. I would recommend selecting the "Advanced Configuration and Power Interface (ACPI) PC" option as a good starting point. Most new hardware will support this option.
- When prompted to create a partition use the following Guidelines:
- Microsoft Best Practices for image deployment suggest that you should use the smallest possible partition size. This will keep the size of the image file reduced and will allow you to deploy the image to machines with smaller hard drives then the original.
Recommended Settings:
- Base Windows XP with SP3:
Create a C:\ partition that is 4030MB in size
- Base Windows XP with SP3 OS + Office
Create a C:\ partition that is 6030MB in size
Important: Leave the remainder of the drive unformatted!
- Do not join the computer to the domain. Just leave the default "Workgroup"
- At the end of the OS install, Windows will prompt you to create a username of the computer. I recommend the name "DELETEME" because it will remind you about the steps you will be taking later in this process.
- When the installation of the OS has completed successfully and you've booted into Windows, open up the Windows Control Panel and select "User Accounts"
- Select "Change the way users log on or off"
- Uncheck "Use the Welcome screen"
- Uncheck "Use Fast User Switching"
- Click "Apply Options"
- Log off of the computer.
- Log on using the username "Administrator" and the password you set during the installation.
- To help standardize the desktop look and feel it is often required that you configure a common "Default" User Profile so that any user created on the computer will maintain the same look at feel. This is done by performing the following steps after you have completed the previous step:
- Open "My Computer"
- Choose "Tools"
- Choose "Folder Options"
- Choose "View"
- Under the "Advanced Settings" scroll down to the bottom of the list and uncheck the box "Use Simple File Sharing."
- Click Apply
- Click Ok
- Open Windows Control Panel
- Choose Add or Remove Programs
- Choose Add/Remove Windows Components
- I would recommend removing the following programs:
- Accessories & Utilities > Games
- MSN Explorer
- Network Services
- Windows Messenger
- To make the image smaller, turn off System Restore as follows:
- Right-click on "My Computer"
- Choose "Properties"
- Select the "System Restore" tab
- Turn off "System Restore"
- Turn off the Windows Swap File as follows:
- Click on the "Start" menu
- Right-click on "My Computer"
- Choose Properties
- Choose Advanced
- Choose Performance
- Choose Settings
- Choose "Virtual Memory"
- Select the C:\ drive
- Select "No paging file"
- Click the Set Button
- Click OK
- Do not reboot yet.
- Make any additional changes required to the Start Menu
- Make any additional changes required to the Desktop
- Make any additional changes required to the Screensaver or Windows Theme
- Make any additional changes required to the Windows Taskbar
- Empty the Windows Recycle Bin
- Reboot the computer
- Logon to the computer with the username "Deleteme" which was created as part of the Windows setup
- Open "My Computer"
- Choose "Tools
- Choose "Folder Options"
- Choose the tab "View"
- Put a check in the box "Show hidden files and folders
- Click OK
- Close "My Computer"
- Click on the Windows Start Menu
- Right-Click on "My Computer"
- Chose Properties
- Choose the tab "Advanced"
- Under the User Profiles section choose "Settings"
- Single-click on the Administrator's profile and choose "Copy To"
- Select Browse, and browse to the folder:
"C:\Documents and Settings\default user"
- Under the "Permitted to use option click "Change"
- Type in "Everyone"
- Click OK
- Click OK to copy the profile
- When this has completed, log off of the computer
- Log onto the computer with the username "Administrator"
- We will now delete the user profile for "DeleteMe" as follows:
- Right-click on "My Computer"
- Choose "Manage"
- Expand "Local Users and Groups"
- Delete the username "DeleteMe"
- Close the MMC
- Open Windows Explorer
- Delete the folder "C:\Documents and Settings\DeleteMe" which is the default user profile that was created.
- Empty the Windows Recycle Bin
- Copy the i386 folder from the Windows XP Pro with SP3 CD to C:\i386
- Change the source paths used by Windows to not point to the CD-ROM as follows:
- Click on the Start button.
- Select Run
- Type in "Regedit" and press "Enter"
- Edit the 4 following Windows registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Setup\Installation Sources to read "C:\"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Setup\ServicePackSourcePath to read "C:\"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Setup\SourcePath to read "C:\"
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\
CurrentVersion\SourcePath to read "C:\i386"
- Reboot the computer to ensure the registry changes you made take effect.
- Log back into Windows using the Administrator account.
- From the Windows XP Sp3 CD, extract the Deploy.cab file located in the Support\Tools folder to C:\Sysprep
- Run c:\sysprep\Setupmgr.exe and complete the Wizard to create a Sysprep.inf file. Be sure to select the "Windows XP Professional" version. At the end of the Wizard, Save the Sysprep.inf to c:\sysprep
- Open C:\sysprep\sysprep.inf to add the following customizations:
- Under the section [Unattended]
- Change InstallFilesPath to read "InstallFilesPath=C:\i386"
- Create the following new entries (without the numbers):
- Under the section [GuiUnattended]
- Create the following new entry:
OEMDuplicatorstring=MMDDYYYY
Note: Substitute the date you create your image for this string. It will be used by Altiris Custom Inventory to be able to track which version of an image is installed on machines in your organization and will provide a great way to identify how old images are. Each time you change you image, update this value with a new date.
- Create the following new entry:
AutoLogon=Yes
AutoLogonCount=2
- Create a new section [GuiRunOnce]
- Create the following entry:
- At the very end of the file create a new section [Sysprep]
- Create the following entry:
- BuildMassStorageSection=Yes
- After the [Sysprep] section create a section [SysprepMassStorage]
- Save the sysprep.inf file and close the file.
- Click the Windows Start Button:
- Select Run
Type in C:\sysprep\sysprep.exe -BMSD
- This will Build the Mass Storage Device Section which will populate the [SysprepMassStorage] section created in the previous step
-
Open the c:\sysprep\sysprep.inf file:
- Verify the [SysprepMassStorage] section is now populated
- Add the following lines at the top of the section:
pnp0303=C:\windows\inf\keyboard.inf
pnp0f03=C:\windows\inf\msmouse.inf
pnp0f0b=C:\windows\inf\msmouse.inf
pnp0f0e=C:\windows\inf\msmouse.inf
pnp0f12=C:\windows\inf\msmouse.inf
pnp0f13=C:\windows\inf\msmouse.inf
- Save the Sysprep.inf file and close it.
- Using Windows Explorer, browse to C:\i386:
- Create a new subfolder named $OEM$ to store the drivers and several other important configuration files.
- In the C:\i386\$OEM$ subfolder, create a text file called cmdlines.txt. This file is used after Sysprep runs but before the Windows login screen and will be used to clean up unnecessary Mass Storage Driver device entries. The contents of the file should read as follows:
[commands]
"C:\Sysprep\Sysprep.exe -clean"
- Create the subfolder C:\i386\$OEM$\$1\Drivers
- Make any last customizations to your image based on your corporate build processes.
- Create a backup image of your computer BEFORE running Sysprep. Because of the nature of Sysprep, you only get one shot to make things work. Rather than starting completely over, using the image you create here will save you lots of time and energy. A suggestion would be to name the image "XPB4SP"
- After the image is completed, reboot the computer into Windows XP. If Windows Plug and Play prompts you to reboot your computer, do so.
- Right-click on "My Computer"
- Choose Manage
- Select "Device Manager"
- Hardware that does not have drivers installed will be listed with a Yellow exclamation point. It is critical to properly uninstall these devices before continuing. To do this, right-click on the device and choose "Uninstall"
- Run C:\sysprep\sysprep.exe -reseal -mini -quiet
Note: Do not be surprised if this step takes up to 30 minutes to run. When it is complete Windows should shut down automatically.
An alternative to this step is to add the -noreboot option to Sysprep which will leave Windows running after Sysprep has completed. Either option will work.
- After Sysprep completes, create a second image of the machine. This is the image you will use to distribute to your environment.
Preparing the Deployment Server:
The following steps should all be completed from the Deployment Server.
- Create the following directory structure:
- Program Files\Altiris\eXpress\Deploy
- Program Files\Altiris\eXpress\Deploy\Scripts
- Program Files\Altiris\eXpress\Drivers
- Browse to Program Files\Altiris\eXpress\Drivers
- Create a subfolder for each computer model in your organization.
For example:
Program Files\Altiris\eXpress\Drivers\GX280
Program Files\Altiris\eXpress\Drivers\P4C800
Etc....
- Underneath each Driver model subfolder, create the following subdirectories:
AUDIO
CHIPSET
INTELINF
MISC1
MISC2
MISC3
MODEM
MONITOR
MOUSE
NET1
NET2
NET3
SCSI
VIDEO
- Extract the sysprep.inf file you originally created as follows:
- Open Altiris Image Explorer:
- Open the XPB4SP.img file
- Extract C:\sysprep\sysprep.inf to \Program Files\Altiris\eXpress\Deploy\scripts
- Close Image Explorer
- Tokenize the sysprep.inf file as follows:
- Open the sysprep.inf file
- Substitute the following values for each of the sections listed below:
Section |
Original Value |
Altiris Token To Enter |
UserData |
ComputerName= |
%COMPNAME% |
UserData |
FullName= |
%USER_NAME% |
UserData |
OrgName= |
%#!computer@lic_os_org% |
Identification |
JoinWorkgroup=
or
JoinDomain=
Note: Normally Sysprep.inf would have one value or the other. Replace whichever you have with this new token
|
%#*"SELECT 'JoinWorkgroup=' FROM computer WHERE domain_member=0 AND computer_id=%ID%"%%#*"SELECT 'JoinDomain=' FROM computer WHERE domain_member=1 AND computer_id=%ID%"%%DOMAIN%
Note: All One Line! |
- Before this next step it is appropriate to discuss that you must now make a choice regarding how Deployment Server will determine which drivers to copy down to the machine. There are two best practice methods: Model Number or Product Name.
Using the Product Name seems to be the most flexible because the model number is sometimes changed by the vendor whereas the Product Name frequently does not.
Method 1: Using the Computer Model Number to copy the appropriate drivers:
Note: The following job was created for use with the Windows PE automation environment. If you are not using Windows PE for your automation environment several steps will need to be adjusted. These will be pointed out for each step.
a. Create a new job in Deployment Server. This job will have 5 tasks. Each task of this job is defined as follows:
-
Distribute Disk Image Task.
The task should have the following properties:
- Point this task to the image you captured after Sysprep was run
- UNCHECK "Prepared using Sysprep"
This is done because you will use different sysprep files based on which HAL is required and the built in functionality of DS doesn't handle this situation at this time.
- UNCHECK "Automatically perform configuration task after completing this imaging task."
- Set the Automation Environment to be "WinPE Managed"
Note: If DOS or Linux is used change this setting as appropriate
- Click "Advanced" then "Additional Options" and add "-restoresig" to the Additional Command Line Options
- Power Control - Reboot
Note: This step is mandatory if "WinPE Managed" was used during the previous step. It is optional for DOS or Linux automation.
- RunScript Task
- Copy and paste the following into the RunScript Task.
@echo off
REM Replace Tokens for Sysprep.inf
REM ReplaceTokens .\deploy\scripts\sysprep-token.txt .\temp\%ID%.inf
Echo Copying Updated Sysprep.inf
.\Rdeploy\windows\firm.exe copy .\temp\%ID%.inf prod:sysprep\sysprep.inf
if "%#!computer@model_num%"=="P4C800-E" goto P4C800
if "%#!computer@model_num%"=="CHANGEME" goto CHANGEME
:P4C800
echo Copying P4C800-E Driver files...
Note: The next two lines should be a single line in the final script!
.\Rdeploy\windows\firm.exe -recurse copy .\Drivers\P4C800 prod:\i386\$oem$\$1\drivers
goto Common
:CHANGEME
echo Copying CHANGEME Driver files...
.\Rdeploy\windows\firm.exe -recurse copy .\Drivers\CHANGEME\ prod:\i386\$oem$\$1\drivers
goto Common
.REM No Model Found
Echo No Computer Model was found. Exiting
Goto Exit
:Common
echo Copying Updated Version of Aclient
.\Rdeploy\windows\firm.exe copy .\aclient.exe prod:altiris\aclient\aclient.exe
.\Rdeploy\windows\firm.exe copy .\aclient.inp prod:altiris\aclient\aclient.inp
:Exit
Note: Use the red section as a guideline for adding your own driver models and sections to this file. The P4C800-E is based on the Asus P4C800-E motherboard.
Note2: The firm commands above must be modified depending on your Automation Environment. See the next page for more details.
Use this table as a reference for how to modify the Run Script task based on the automation environment:
Automation Environment |
Firm Command Line To Substitute |
DOS |
Firm.exe |
Windows PE |
.\Rdeploy\Windows\Firm.exe |
Linux |
.\Rdeploy\Linux\firm |
- Choose the script operating system "Windows"
- Click Next
- Select "Automation - PXE or Bootworks environment (DOS/Windows PE/Linux)
- Select "WinPE Managed"
- Power Control - Reboot
- This next Run Script task is optional but highly recommended! This script will properly set the Windows XP Firewall for the exceptions required to ensure Altiris will function, Turn off Simple File Sharing, and Install the Altiris NS Agent.
To use this, copy and paste the following into the Run Script:
REM Set XP Firewall Exceptions and Install NS Agent
REM If the OS is XP then set FW and SFS else Start Agent Install
if not exist %windir%\system32\fwcfg.dll goto AA
REM Apply Windows Internet Connection Firewall Exceptions if they haven't been applied
if exist %windir%\system32\AltirisFW.log goto AA
XCopy /Y \\Altiris\express\deploy\scripts\NETFW.INF %windir%\INF >NUL
netsh firewall reset >NUL
echo Firewall Exceptions Completed on: %DATE% %TIME%>%windir%\system32\AltirisFW.log
REM Turn Off Simple File Sharing in Windows XP
echo y|REG ADD \\%COMPUTERNAME%\HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v forceguest /t REG_DWORD /d 0 >NUL
echo Simple File Sharing turned off on: %DATE% %TIME%>>%windir%\system32\AltirisFW.log
:AA
REM Start Altiris Agent Installation
if exist %windir%\system32\aexswdinstsvc.exe goto BB
xcopy /Y "\\Altiris\NSCap\Bin\Win32\X86\aexswdinstsvc.exe" %windir%\system32 >NUL
:BB
REM Install Altiris Agent if it does not exist
if exist %windir%\system32\aexnsc.log goto END
%windir%\system32\aexswdinstsvc.exe -u "http://Altiris/Altiris/NS/nscap/bin/win32/x86/ns client package/aexnsc.exe" -s "Altiris.internal.aftersixcomputers.com" -w "http://Altiris.internal.aftersixcomputers.com/Altiris" -d "C:\Program Files\Altiris\Altiris Agent" -nostartmenu >NUL
echo Altiris Agent Installation Completed on: %DATE% %TIME%>%windir%\system32\AltirisAgents.log
:end
- Choose the script operating system Windows
- Click Next
- Choose "On the Client Computer"
- Choose Production - Client-installed OS (Windows/Linux)
- Choose Security Context "Default (local system account)
Method 2: Using Product Name to copy the appropriate drivers:
A. To use the Product Name as the primary lookup value, a new table view must be created in the eXpress Database. This is because the product names are going to have spaces in them and name comparisons won't work properly if they contain spaces. To create the new view Run the following SQL Script using SQL Query Analyzer against the eXpress database:
CREATE function make_readable(
@comp_id INT)
RETURNS VARCHAR(64)
AS
BEGIN
return (SELECT replace(prod_name, ' ', '_') FROM computer where computer_id = @comp_id)
END
GO
CREATE View dbo.comp_view AS
SELECT computer_id, computer_name, group_id, serial_num, manuf, processor_count, bios_version, dbo.make_readable(computer_id) as 'model'
FROM dbo.computer
GO
B. The only other change from Method 1 is that the RunScript Task detailed in Method 1 needs a slight modification. Modify the sections in red as follows:
****SNIP FROM METHOD 1 *******
@echo off
REM Replace Tokens for Sysprep.inf
REM ReplaceTokens .\deploy\scripts\sysprep-token.txt .\temp\%ID%.inf
Echo Copying Updated Sysprep.inf
.\Rdeploy\windows\firm.exe copy .\temp\%ID%.inf prod:sysprep\sysprep.inf
Set model=%#!comp_view@model%
if "%model%"=="OptiPlex_GX620" goto GX260
if "%model%"=="CHANGEME" goto CHANGEME
**** END SNIP FROM METHOD 1 *******
- After following these 5 steps the Deployment Server job is successfully configured.
HAL Driver Replacement
When Sysprep was introduced with Windows 2000, and then vastly improved with the release of Windows XP, Microsoft addressed many of the limitations that existed at the time for creating a hardware independent image. But one major technical hurdle still exists to creating a master image that does not rely on any one physical hardware component. This limitation is known as the Hardware Abstraction Layer (HAL).
Technically speaking, the HAL is a thin layer of software provided by the hardware manufacturer that hides, or abstracts, hardware differences from higher layers of the operating system. By means of the filter provided by the HAL, different types of hardware look alike to the rest of the operating system. This allows the operating system to be portable from one hardware platform to another. The HAL also provides routines that allow a single device driver to support the same device on all platforms. And while this may sound like a good recipe for a hardware independent image, the problem is that there are currently six (6) different HAL's (see Microsoft KB 309283 for more details). To give you an idea of how complicated this can become, take a look at the following table provided by Microsoft:
|
The HAL of the Destination Computer |
HAL of Master Computer |
ACPI
APIC UP |
ACPI
APIC MP
|
Non-ACPI
APIC UP |
Non-ACPI
APIC MP |
ACPI APIC UP |
X |
X |
|
|
ACPI APIC MP |
X |
X |
|
|
Non-ACPI APIC UP |
|
|
X |
X |
Non-ACPI APIC MP |
|
|
X |
X |
Important Notes:
UP stands for Uni-processor (1 CPU)
MP stands for Multi-processor (2 CPU).
MP includes machines with Hyper threading and Dual-Core Machines |
Luckily, most computer manufacturers build hardware that is compatible with two of the six. These two are the:
"Advanced Configuration and Power Interface HAL (halacpi.dll)
"ACPI Uniprocessor PC HAL (halaacpi.dll)
Your task is to determine which computers need which HAL and install the appropriate one because no system can have two HALs. The following two (2) methods are the most commonly accepted methods to updating the master image with the appropriate HAL. Understand now that both methods have limitations and there is a trade-off you will need to make by picking one or the other. The good news is that Windows Vista does not have a HAL and so these problems will soon be a thing of the past.
Method 1: The Microsoft Supported Way
Method 1 is the only method officially supported by Microsoft and the only method you will be able to receive technical support on in the event something should go wrong.
Before we dig into the steps, understand that this method has limitations. First, Microsoft Sysprep will be responsible for updating the HAL. This means that this method will only work if you run Sysprep in Mini-Setup mode. The HAL will not change if you run Sysprep in Factory or Reseal mode. Secondly, you will be required to use more than 1 sysprep.inf file. You will also be required to re-organize your RunScript task so that you decide based on the model number which sysprep file is copied.
This method assumes you have followed the step by step process as detailed in early sections of this document. This would include starting the process by creating an image from an ACAPI computer.
To use Method 1 performs the following:
- Using Windows Explorer, browse to the
\Program Files\Altiris\eXpress\Deployment Server\Deploy\Scripts directory
- Rename sysprep.inf file to ACAPI_Sysprep.txt
- Create a second copy:
- Right-click on ACAPI_Sysprep.txt
- Choose Copy
- Right-click inside the scripts directory and choose Paste
- Rename the file to MP_Sysprep.txt
- At this point you should now have two copies of your original Sysprep.inf with new names
- Add a new line to the MP_Sysprep.txt as follows:
- Open MP_Sysprep.txt
- Find the [Unattended] section
- Add the following to the last line of this section:
UpdateUPHal=ACPI APIC_MP,%windir%\inf\hal.inf
Note: Yes there is a space between ACPI and APIC_MP. Make sure you do not skip this.
- Now that you have two HALs to work with, go back to your Distribute Disk Image job. Modify the first "Run Script Task" to do the following:
- Move the "IF" statement to the beginning of the script
- Underneath each computer model number insert the Token Replacement line, substituting the appropriate sysprep.inf. This will be repeated for each model number.
Your script should now look similar to:
*****BEGIN CODE SNIP*****
@echo off
if "%#!computer@model_num%"=="P4C800-E" goto P4C800
if "%#!computer@model_num%"=="CHANGEME" goto CHANGEME
:P4C800
REM Replace Tokens for Sysprep.inf
REM ReplaceTokens .\deploy\scripts\MP_Sysprep.txt .\temp\%ID%.inf
Echo Copying Updated Sysprep.inf
.\Rdeploy\windows\firm.exe copy .\temp\%ID%.inf prod:sysprep\sysprep.inf
Echo Copying P4C800-E Driver files...
Note: The next two lines should be a single line in the final script!
.\Rdeploy\windows\firm.exe -recurse copy .\Drivers\P4C800 prod:\i386\$oem$\$1\drivers
goto Common
:CHANGEME
REM Replace Tokens for Sysprep.inf
REM ReplaceTokens .\deploy\scripts\ACAPI_Sysprep.txt .\temp\%ID%.inf
Echo Copying Updated Sysprep.inf
.\Rdeploy\windows\firm.exe copy .\temp\%ID%.inf prod:sysprep\sysprep.inf
echo Copying CHANGEME Driver files...
.\Rdeploy\windows\firm.exe -recurse copy .\Drivers\CHANGEME\ prod:\i386\$oem$\$1\drivers
goto Common
REM No Model Found
Echo No Computer Model was found. Exiting
Goto Exit
:Common
*****END CODE SNIP*****
- You have successfully completed Method 1.
Method 2: The Altiris Workaround
As mentioned in the previous section, this method is NOT supported by Microsoft. Microsoft Support may refuse support for any issues you have with the Windows OS if this process is followed during the deployment. Use this process at your own risk.
Secondly, the automation in this process depends on Windows PE to be used as your automation agent.
- Perform the following from the Deployment Server
- Insert a Windows XP Pro with SP3 CD
- Extract the HAL.dll files by performing the following:
- Create a new directory under the express share:
\Program Files\Altiris\eXpress\Deploy\HALs
- Open a Command Prompt
- iii. Type in the following (on one line):
"Expand -r Z:\i386\hal*.*
C:\Program Files\Altiris\eXpress\Deploy\HALs"
- Modify the Run Script created earlier in this document that performs the Sysprep Token Replacement as follows.
*****BEGIN CODE SNIP*****
@echo off
if "%#!computer@model_num%"=="P4C800-E" goto P4C800
if "%#!computer@model_num%"=="CHANGEME" goto CHANGEME
:P4C800
REM Replace Tokens for Sysprep.inf
REM ReplaceTokens .\deploy\scripts\sysprep-token.txt .\temp\%ID%.inf
Echo Copying Updated Sysprep.inf
.\Rdeploy\windows\firm.exe copy .\temp\%ID%.inf prod:sysprep\sysprep.inf
Echo Copying P4C800-E Driver files...
Note: The next two lines should be a single line in the final script!
.\Rdeploy\windows\firm.exe -recurse copy .\Drivers\P4C800 prod:\i386\$oem$\$1\drivers
goto HAL
:CHANGEME
REM Replace Tokens for Sysprep.inf
REM ReplaceTokens .\deploy\scripts\sysprep-token.txt .\temp\%ID%.inf
Echo Copying Updated Sysprep.inf
.\Rdeploy\windows\firm.exe copy .\temp\%ID%.inf prod:sysprep\sysprep.inf
echo Copying CHANGEME Driver files...
.\Rdeploy\windows\firm.exe -recurse copy .\Drivers\CHANGEME\ prod:\i386\$oem$\$1\drivers
goto HAL
REM No Model Found
Echo No Computer Model was found. Exiting
Goto Exit
:HAL
REM Determine HAL based on registry values
REM Is the HAL ACPI UP
Note: The next 3 lines should be 1 continuous line. Be very cautious about spacing. There is no space between the "|" and the "C:\windows...." line
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |C:\windows\system32\Find /I /C "acpipic_up" >NUL
IF %ERRORLEVEL%==0 GOTO ACPI
:REGQ2
REM Is the HAL Uniprocessor Hal
Note: The next 3 lines should be 1 continuous line. Be very cautious about spacing. There is no space between the "|" and the "C:\windows...." line
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |C:\windows\system32\Find /I /C "acpiapic_up" >NUL
IF %ERRORLEVEL%==0 GOTO AACPI
:REGQ3
REM Is the HAL Multiprocessor Hal
Note: The next 3 lines should be 1 continuous line. Be very cautious about spacing. There is no space between the "|" and the "C:\windows...." line
REG QUERY HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /v HardwareId |C:\windows\system32\Find /I /C "acpiapic_mp" >NUL
IF %ERRORLEVEL%==0 GOTO MACPI
:ACPI
REM Copy ACPI HAL
echo You went to ACPI
.\Rdeploy\Windows\Firm.exe copy .\Deploy\HALs\halacpi.dll prod:Windows\System32\hal.dll
GOTO Common
:AACPI
REM Copy AACPI HAL
echo You went to AACPI
REM .\Rdeploy\Windows\Firm.exe copy .\Deploy\HALs\halaacpi.dll prod:Windows\System32\hal.dll
GOTO Common
:MACPI
REM Copy MACPI HAL
echo You went to MACPI
REM .\Rdeploy\Windows\Firm.exe copy .\Deploy\HALs\halmacpi.dll prod:Windows\System32\hal.dll
GOTO Common
:Common
*****END CODE SNIP*****
- You have successfully completed Method 2
Troubleshooting
Microsoft's Sysprep Process is not exactly foolproof and sometimes it just doesn't work as expected. The following are a collection of troubleshooting tips you might try if following the steps above do not function as expected.
Tip 1:
Remember, if you don't think your script is working properly, insert a "pause" command after each component of your script and try the job again. The "pause" statement will force the script to pause so you can determine where the process is broken.
Tip 2:
By default, when Windows XP Pro is installed, the following registry entry is created:
Type |
Key |
Value |
Reg_Expand_SZ |
HKEY_LOCAL_MACHINE\Software\
Microsoft\Windows\CurrentVersion\
DevicePath |
%SystemRoot%\inf |
Whenever Windows detects new hardware the OS uses the values in this registry setting to locate the driver files. When Sysprep is run, the value of this registry entry should match the OEMPNPDriversPath line from the sysprep.inf file. If it does not, Windows will not be able to locate the drivers. Checking the value of this entry is one of the first steps to discovering why drivers are not installing properly.
In testing Hardware Independent Imaging at several customer locations, sometimes if you delete the value of this registry key (not the key itself) BEFORE running Sysprep the value will then be overwritten during the mini-setup portion of the Windows installation. Microsoft documentation on Sysprep suggests that this behavior should not happen but it might work if you are having issues with Drivers not installing properly.
Tip 3:
In some cases, the OEMPNPDriversPath must include a leading "\" before the i386 directory so that the entry reads "\i386\$OEM$\$1\Drivers\IntelInf;"
Tip 4:
After the Windows XP Pro Setup process completes successfully, a log of the installation will be created in C:\Windows\setuplog.txt. Reading this file will most likely reveal the following error:
Warning
Setup was unable to change the password for the user account Administrator because of the following error:
SamChangePasswordUser returned status c000006a
This error is caused by the Mini-Setup wizard. When it runs, it attempts to reset the local administrator password; however, because the password was set during the original installation of Windows, the Mini-Setup wizard is unable to reset the password. This error can be ignored. For more details see Microsoft KB 200607. For customers concerned with managing and maintaining the local admin passwords reference the Altiris Local Security Solution product.
Tip 5:
One of the most frustrating problems is when Drivers will not install automatically. This can often times be due to nothing more than the folder structure not being accurate. Paying attention to the folder structure of the \Drivers folder will help smooth this process.