Windows XP SP3 is Out - Time to Rebuild Those Base Images!

Windows XP SP3 is Out - Time to Rebuild Those Base Images!
vortex0007's picture

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

  1. 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.
    1. Do not install any drivers onto the machine as part of the OS build.
    2. Do not have any external devices plugged into the computer such as Scanners, Printers, USB Devices, etc.
  2. 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:

    1. 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.
    2. 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!

    3. Do not join the computer to the domain. Just leave the default "Workgroup"
    4. 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.
  3. 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"
    1. Select "Change the way users log on or off"
    2. Uncheck "Use the Welcome screen"
    3. Uncheck "Use Fast User Switching"
    4. Click "Apply Options"
  4. Log off of the computer.
  5. Log on using the username "Administrator" and the password you set during the installation.
  6. 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:
    1. 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
    2. 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
    3. 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"
    4. Turn off the Windows Swap File as follows:
      1. Click on the "Start" menu
      2. Right-click on "My Computer"
      3. Choose Properties
      4. Choose Advanced
      5. Choose Performance
      6. Choose Settings
      7. Choose "Virtual Memory"
      8. Select the C:\ drive
      9. Select "No paging file"
      10. Click the Set Button
      11. Click OK
      12. Do not reboot yet.
    5. Make any additional changes required to the Start Menu
    6. Make any additional changes required to the Desktop
    7. Make any additional changes required to the Screensaver or Windows Theme
    8. Make any additional changes required to the Windows Taskbar
    9. Empty the Windows Recycle Bin
    10. Reboot the computer
    11. Logon to the computer with the username "Deleteme" which was created as part of the Windows setup
    12. 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"
    13. 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
  7. Log onto the computer with the username "Administrator"
  8. We will now delete the user profile for "DeleteMe" as follows:
    1. Right-click on "My Computer"
    2. Choose "Manage"
    3. Expand "Local Users and Groups"
    4. Delete the username "DeleteMe"
    5. Close the MMC
    6. Open Windows Explorer
    7. Delete the folder "C:\Documents and Settings\DeleteMe" which is the default user profile that was created.
    8. Empty the Windows Recycle Bin
  9. Copy the i386 folder from the Windows XP Pro with SP3 CD to C:\i386
  10. 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"

  11. Reboot the computer to ensure the registry changes you made take effect.
  12. Log back into Windows using the Administrator account.
  13. From the Windows XP Sp3 CD, extract the Deploy.cab file located in the Support\Tools folder to C:\Sysprep
  14. 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
  15. Open C:\sysprep\sysprep.inf to add the following customizations:
    1. Under the section [Unattended]
      • Change InstallFilesPath to read "InstallFilesPath=C:\i386"
      • Create the following new entries (without the numbers):
        • UnattendMode=FullUnattended
        • OEMPreinstall=Yes
        • NoWaitAfterTextmode=1
        • NoWaitAfterGUIMode=1
        • ExtendOEMPartition=1
        • OEMPnPDriversPath= \windows\inf;

          \i386\$oem$\$1\drivers\intelinf;

          \i386\$oem$\$1\drivers\chipset;

          \i386\$oem$\$1\drivers\video;

          \i386\$oem$\$1\drivers\audio;

          \i386\$oem$\$1\drivers\net1;

          \i386\$oem$\$1\drivers\net2;

          \i386\$oem$\$1\drivers\net3;

          \i386\$oem$\$1\drivers\misc1;

          \i386\$oem$\$1\drivers\misc2;

          \i386\$oem$\$1\drivers\misc3;

          \i386\$oem$\$1\drivers\modem;

          \i386\$oem$\$1\drivers\monitor;

          \i386\$oem$\$1\drivers\mouse;

          \i386\$oem$\$1\drivers\scsi;

          Note: the previous entry is one continuous line -
          do not break the up into multiple lines!

        • ResetSourcePath=C:
        • DriverSigningPolicy=Ignore
        • UpdateInstalledDrivers=Yes
    2. 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

    3. Create a new section [GuiRunOnce]
      • Create the following entry:
        • "C:\altiris\aclient\aclient.exe C:\altiris\aclient\aclient.inp -silent -install -scriptedinstall"

          (All one continuous line)

    4. At the very end of the file create a new section [Sysprep]
      • Create the following entry:

        • BuildMassStorageSection=Yes
    5. After the [Sysprep] section create a section [SysprepMassStorage]
    6. Save the sysprep.inf file and close the file.
  16. Click the Windows Start Button:
    1. 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
  17. Open the c:\sysprep\sysprep.inf file:

    1. Verify the [SysprepMassStorage] section is now populated
    2. 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
      
      			
      			
    3. Save the Sysprep.inf file and close it.
  18. Using Windows Explorer, browse to C:\i386:
    1. Create a new subfolder named $OEM$ to store the drivers and several other important configuration files.
    2. 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"
      			
    3. Create the subfolder C:\i386\$OEM$\$1\Drivers
  19. Make any last customizations to your image based on your corporate build processes.
  20. 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"
  21. After the image is completed, reboot the computer into Windows XP. If Windows Plug and Play prompts you to reboot your computer, do so.
  22. Right-click on "My Computer"
    1. Choose Manage
    2. Select "Device Manager"
    3. 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"
  23. 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.
  24. 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.

  1. Create the following directory structure:
    • Program Files\Altiris\eXpress\Deploy
    • Program Files\Altiris\eXpress\Deploy\Scripts
    • Program Files\Altiris\eXpress\Drivers
  2. Browse to Program Files\Altiris\eXpress\Drivers
    1. 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....
    2. Underneath each Driver model subfolder, create the following subdirectories:

      AUDIO

      CHIPSET

      INTELINF

      MISC1

      MISC2

      MISC3

      MODEM

      MONITOR

      MOUSE

      NET1

      NET2

      NET3

      SCSI

      VIDEO

  3. Extract the sysprep.inf file you originally created as follows:
    1. Open Altiris Image Explorer:
    2. Open the XPB4SP.img file
    3. Extract C:\sysprep\sysprep.inf to \Program Files\Altiris\eXpress\Deploy\scripts
    4. Close Image Explorer
  4. 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!
  5. 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:

  1. Distribute Disk Image Task.
    The task should have the following properties:

    1. Point this task to the image you captured after Sysprep was run
    2. 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.
    3. UNCHECK "Automatically perform configuration task after completing this imaging task."
    4. Set the Automation Environment to be "WinPE Managed"
      Note: If DOS or Linux is used change this setting as appropriate
    5. Click "Advanced" then "Additional Options" and add "-restoresig" to the Additional Command Line Options
  2. 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.
  3. RunScript Task
    1. 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
    2. Choose the script operating system "Windows"
    3. Click Next
    4. Select "Automation - PXE or Bootworks environment (DOS/Windows PE/Linux)
    5. Select "WinPE Managed"
  4. Power Control - Reboot
  5. 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
    
    
    1. Choose the script operating system Windows
    2. Click Next
    3. Choose "On the Client Computer"
    4. Choose Production - Client-installed OS (Windows/Linux)
    5. 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 *******
    
    
  6. 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:

  1. Using Windows Explorer, browse to the
    \Program Files\Altiris\eXpress\Deployment Server\Deploy\Scripts directory

    1. Rename sysprep.inf file to ACAPI_Sysprep.txt
    2. 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
  2. Add a new line to the MP_Sysprep.txt as follows:
    1. Open MP_Sysprep.txt
    2. Find the [Unattended] section
    3. 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.
  3. 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:
    1. Move the "IF" statement to the beginning of the script
    2. 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*****
    
    
  4. 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.

  1. Perform the following from the Deployment Server
    1. Insert a Windows XP Pro with SP3 CD
    2. 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"
  2. 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*****
    
    
  3. 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.

4.288135
Average: 4.3 (59 votes)

Excellent Article

FrankB's picture

But keep in mind that there is an issue with the SP, it causes unlimited reboots on certain AMD processor machines.

Cheers, FrankB

I can see a lot of time was

I can see a lot of time was put into this. Forgive me if any of the following suggestions were mentioned and overlooked by myself.

1)
I would recommend increasing OEMPNPDriversPath to include more placeholder folders. This comes up a lot with laptops and all the extras (Bluetooth, TPM, fingerprint, card readers). People don't realize they have to revert back to their base image to change OEMPNPDriversPath. You cannot just make a new sysprep injection template. The place holders will save you down the road.

I use c:\drivers but here is an example:

OEMPNPDriversPath="\drivers\chipset;\drivers\video;\drivers\nic;\drivers\audio;\drivers\modem;\drivers\wireless;\drivers\1;\drivers\2;\drivers\3;\drivers\4;\drivers\5;\drivers\6;\drivers\7;\drivers\8;\drivers\9;\drivers\10;\drivers\11;\drivers\12;\drivers\13;\drivers\14;\drivers\15;\drivers\16;\drivers\17;\drivers\18;\drivers\19;\drivers\20"

You may not nest drivers within your drivers folder. Sysprep only looks in the root of the folder. All your .cat/.inf driver files should be in the root and not in a subfolder of what is listed in the oempnpdriverspath

2)
Be sure to clear the IE cache/files/settings as well as the event logs before copying the administrator profile over the top of the Default User

3) Additionally, don't forget to set your laptop power settings before copying the profile over the Default User. Most people neglect to do this since they aren't available in the Power Settings GUI when making your image on a desktop

To accomplish this you can use commands similar to the following:

powercfg /change "Home/Office Desk" /monitor-timeout-ac 30
powercfg /change "Home/Office Desk" /monitor-timeout-dc 5
powercfg /change "Home/Office Desk" /disk-timeout-ac 0
powercfg /change "Home/Office Desk" /disk-timeout-dc 30
powercfg /change "Home/Office Desk" /standby-timeout-ac 0
powercfg /change "Home/Office Desk" /standby-timeout-dc 25
powercfg /hibernate on
powercfg /change "Home/Office Desk" /hibernate-timeout-ac 0
powercfg /change "Home/Office Desk" /hibernate-timeout-dc 0
powercfg /change "Home/Office Desk" /processor-throttle-ac none
powercfg /change "Home/Office Desk" /processor-throttle-dc adaptive

4)
Lastly, the UAA HD audio patch 888111 is included in SP3 now, but if you find any similar hotfixes or patches that need to be installed after the image is built, consider using the cmdlines.txt files to do an unattended installation of them.

I’m sure many people will benefit from this article. I know I was able to think of a couple things to address in my own notes after reading it.

Thanks.

AMD-based computer

riva11's picture

There is a good article made by Jesper Johansson about how to understand and solve this "endless reboots" issues on AMD CPU machines.
Link : Does your AMD-based computer boot after installing XP SP3?

In this article has been pubblished a small tool , 16K , (Link : removeIntelPPMonAMD.vbs ) that checks if is running an AMD CPU. In this case , continue checking in the Windows registry to see if this computer could be affected in this issue, and eventually is asked to disable the Windows update.

This issue was resolved

vortex0007's picture

Microsoft has fixed this problem so that it no longer occurs.

Awsome Article

KeithB's picture

If any of you do copy profile to Default User, you will need to make sure the user's profile being copied has a My Documents folder in it, without the Desktop.ini file.

WinXP SP3 changed the version of FDEPLOY.exe which does folder redirection. In the old version of the file My Documents had to be deleted from the profile to be copied. Now it needs to be there.

Boston Altiris User Group Webmaster

New DEPLOY.CAB available

Stu Harris's picture

Here is a direct link to the newer DEPLOY.CAB that was released with XP SP3:

http://www.microsoft.com/downloads/details.aspx?fa...

good..

dfnkt_'s picture

Good article! I choose to hand enter my DevicePath into the registry in lieu of passing it through OEMPNPDriversPath. DriversPath has a limitation of characters (4096) but I have had issues after reaching as few as 96 characters. If you also choose to put the entries straight into the registry be sure to include %systemdrive%\ in front of each entry, OEMPNPDriversPath prepends this for you.

SP...

trb48's picture

Some people may be tempted to deploy an existing image on a test computer, install SP3, and then take another image. This may cause lots of problems. I suggest starting over. This may take longer, but it will solve lots of problems. It will also help make your image smaller.

Another thing that I like to do with my driver deals with organization. I like to organize my files by model and then hardware type. For example: D:\GX620\Audio. This helps me update my drivers much faster.

SP...

And the real die-hard does a clean installation with a slipstreamed Windows XP - SP3, for practically no exces bagage.

Addition/Clarification to Step 2a

RFredette's picture

A a rookie HAL image creator, I am working my way through these (wonderful!) instructions, and would like to point out to others that in step 2a the system only shows 2 lines of options for HAL layers at a time. You need to use the arrow keys to scroll through the HAL options in order to choose the ACPI option. Just a tip...

Question

In the instructions at step 6 substep 15a Create the following new entries (without the numbers), Are you referring to the numbers that are in the OEMPnPDriversPath also?

HAL Replacement only works in WINPE 2005

Finding the correct HAL Version only works in WINPE 2005. WINPE 2.1 (the Vista SP1 Version WAIK)always loads the same HAL because Vista is HAL independent.
So if you are using a new installation of DS 6.9 it only supports WINPE 2.1!.

HAL Replacement only works in WINPE 2005

kpjernigan's picture

Actually thats not entirely the case. We've been running DS 6.9 with the PE2.1 and the HAL Detect VBS file (As referenced in: A geeks guide to Windows XP HAL Replacement - http://www.myitforum.com/articles/15/view.asp?id=8... ) which we've incorporated into our imaging procedure via a run script job after the image is deployed, still detects the proper HAL and updates the [Unattended] section of sysprep.inf with the proper statement to load the correct HAL w/o using FIRM injection.

"... If the target computer has a ACPI Uniprocessor PC HAL Type - the script adds the following line to the [Unattended] section of sysprep.inf
"UpdateUPHAL = "ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf"

If the target computer has a ACPI Multiprocessor PC HAL Type - the script adds the following line to the [Unattended] section of sysprep.inf
"UpdateHAL = "ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf"
... "

SP3 can be installed immediately after image deployment

Hi guys,
If time is the issue to update the images to SP3, SP3 can be installed immediately after image deployment as a task from Deployment Server. It takes about 20 minutes and can be installed silently and automatically. Works fine for us

Andrey Shipov
Manchester, UK

Problem with ReplaceTokens

Hey

first i want to thank author for great guide.

But now the problem im facing. Im using DS6.9 and linux as pxe booting environment. In my script i have

# ReplaceTokens /mnt/ds/Deploy/scripts/MP_sysprep.txt /mnt/ds/Temp/a%ID%.txt

but it does'nt create the file to that directory. If i just copy a file from source to destination it works, so acl is not an issue. Can someone help me to figure out why it does not work for me?

need to add a copy command

vortex0007's picture

The ReplaceTokens command doesn't actually copy files - it simply replaces files that are already there. Modify your command as follows (all on one line):

# ReplaceTokens cp /mnt/ds/Deploy/scripts/MP_sysprep.txt /mnt/ds/Temp/a%ID%.txt

see if that solves the problem you are having.

Tnx for quick answer, but

Tnx for quick answer, but it didnt do anything. In Temp directory it does not create that file.

I know you are using linux,

I know you are using linux, but try using REM

REM ReplaceTokens .\Sysprep\HIIProd.inf .\Temp\%COMPNAME%.inf

not sure but since ReplaceTokens isn't any type of command line program its DS thats looking for that particular string to process the tokens. These tokens are after all only meaningful to DS.