Jump to content

WDS, WinPE and HALs on XP and Vista


Tripredacus

Recommended Posts

So does that script automatically choose the multiprocessor ACPI HAL or the normal uniprocessor ACPI HAL based on what type of computer it's being installed on? Where in the setup process can I insert the script? Although I have used RIS in the past, I am new to WDS, and I'd like to not have to have two different images on the WDS server if possible.

Well, the script doesn't choose the HAL, it updates sysprep.inf with whatever HAL is being used on the PC.

I have the script set to run after I've loaded the image on the drive using imagex.

I have one image for all the PC's I use and it works great for me.

How do you trigger the script to run?

Link to comment
Share on other sites


  • 2 weeks later...
  • 4 months later...

I hope someone can answer me on this, when we deploy an image that is based on a single processor that we get a BSOD. To encounter this we must change SATA in bios to compatibility instead of ACPI. After that the machine boot normally and continue install.

Is there any way to solve this by not touching to the bios and not get this **( :realmad: )** BSOD?

Link to comment
Share on other sites

I have to throw my 2 cents in here. I used to be a big fan of imaging, back in Windows 3.1 days. When Win95/NT came out I battled with imaged deployments for a year. I finally started doing it the "right" way by using scripted deployments.

Look, it's plain and simple, and it's been a fact of Windows deployments for over 10 years - Imaged deployments suck! If you want to properly deploy Windows NT/2000/2003/XP you use unattended scripted installations. Yes, they're hard to do, Yes - they take forever to install. But it's the only way to the best Windows installation possible. However, once you got it setup it's easy to maintain. Imaged deployments are inherently unstable - especially if you image the applications along with the OS installation.

I always argue with inexperienced admins about imaged deployments, because they are just being lazy. They always mention "well so and so does it", or "HP and Dell use images to deploy their systems". Well, ya they do - and they are idiots. They hired noobs to do their deployments. Recently HP got bit in the a** because they stupidly use imaged deployments to roll out XP.

Imaged deployments actually get me angry, from having to deal with their issues over and over again throughout the years. They make Windows unstable and I firmly believe that the reputation of Microsoft Windows being unstable is directly related to crappy imaged deployments.

So get off your a** and learn to do scripted installations!

Link to comment
Share on other sites

  • 1 month later...
This has nothing to do with the processor but everything to do with the Mass Storage Controller. Have sysrpep add the mass storage controller drivers you need and you should be cood to go.

So my problem getting this BSOD from the fact that if I don't change AHCI to compatibility is related to the "Mass Storage Controller"? How can I include those controllers and add a maximum so I won't have to make each month a new image?

Link to comment
Share on other sites

I've never sen a BSOD because of an incompatible HAL, usually it just won't boot. If you are getting a BSOD, it is usually 0x0000007b bsod which has to do with the mass storage controller not the HAL.

Can you point me out to a good guide that explains how to implement those mass storage controller?

Link to comment
Share on other sites

I have to throw my 2 cents in here. I used to be a big fan of imaging, back in Windows 3.1 days. When Win95/NT came out I battled with imaged deployments for a year. I finally started doing it the "right" way by using scripted deployments.

Look, it's plain and simple, and it's been a fact of Windows deployments for over 10 years - Imaged deployments suck! If you want to properly deploy Windows NT/2000/2003/XP you use unattended scripted installations. Yes, they're hard to do, Yes - they take forever to install. But it's the only way to the best Windows installation possible. However, once you got it setup it's easy to maintain. Imaged deployments are inherently unstable - especially if you image the applications along with the OS installation.

I always argue with inexperienced admins about imaged deployments, because they are just being lazy. They always mention "well so and so does it", or "HP and Dell use images to deploy their systems". Well, ya they do - and they are idiots. They hired noobs to do their deployments. Recently HP got bit in the a** because they stupidly use imaged deployments to roll out XP.

Imaged deployments actually get me angry, from having to deal with their issues over and over again throughout the years. They make Windows unstable and I firmly believe that the reputation of Microsoft Windows being unstable is directly related to crappy imaged deployments.

So get off your a** and learn to do scripted installations!

Well my reply to this is to learn how to do a proper image :)

The trick is to have proper methods and routines to create your image. If you just do it by hand and feel, then you will have a mess. If you do in a structured way you will have a well working soloution that saves a lot of time and money, troubleshoting is easier too since you will have an identical machine to do it from.

The best way to accive this is actually to use a scripted installation to generate the image based installation.

In our production enviroment we uses an in house developed four step method:

0. Operating system and mui

1. Hotfixes/patches and apps

2. Gui Adjustments

3. Defrag and sysprep

for each of these steps we take a new image, therefore it's wery rare that we do a new 0 image. Uasally we just load that up from disk, and goes into step one, adds the last months uppdates, patches and changed apps. Step two is mostly automated but some GUI tweaks requiers manual adjustments, therefore we have a checklist for that, Step three is fully auto with the exption of adjusting sysprep inf for new massstorage controllers. This gives us very stable "fat" images containing everything an ordinary user requires to start working.

Doing this the scripted way takes about 6-7 Hours, With imaging it taks 30 min to reinstall a PC. This means that we don't do deeper troubleshoting of software problems anymore. Helpdesk uses 15 max to try and fix it, if they can't they reinstall the PC remotly or asks the user to press F12 to start the reinstallation manually. A coffeebreak (about 30 min) later he/she has a working machine again. If you compare that with dispatching a tech and in worst case having the box replaced, imaging saves time for the users and lowers our operating costs. Especially if you have many offices and don't have local techs on all locations

Sure it takes some time to maintain the images but with 19K boxes it's sufficient to save a few minutes/a box to pay for the image handeling time. The rest is a bonus.

Link to comment
Share on other sites

  • 1 month later...

I would like to add Johan Arwidmark's latest Z-HalDetect script into my WinPe 2.01 process without having to use MDT2008 or BDD 2007. Currently I deliver our XP image from a USB drive. I'm guessing that after the image is applied and before restarting the PC I need to call a script that will check the HAL type and modify the sysprep file. What modifications are necessary to run this script after imagex has applied the image to the C partition? I would really appreciate any help.

<job id="ZeroTouchInstallation">
<script language="VBScript" src="ZTIUtility.vbs"/>
<script language="VBScript">

'//////////////////////////////////////////////////
'//
'// Script File:
'//
'// Z-HalDetect_standalone_version.wsf
'//
'// This script updates sysprep.inf with correct HAL Type
'// The Reference (master) image should have an Advanced ACPI HAL type.
'//
'// This version does not require the MDT 2008 environement being present,
'// E.g. can be used with Intel LANDesk or Altiris (Note: ZTIUtility.vbs from
'// MDT 2008 must be added to the same folder)
'//
'// This script assumes the following files are being present in C:\Drivers\UniProcHAL
'// hal.dll (Renamed from halaacpi.dll to hal.dll)
'// ntkrnlpa.exe
'// ntoskrnl.exe
'//
'// Author: Johan Arwidmark
'// URL: [url="http://www.deployvista.com"]http://www.deployvista.com[/url]
'//
'// Disclaimer
'// This script is provided "AS IS" without express
'// or implied warranty of any kind.
'//
'//////////////////////////////////////////////////


' Customize the local sysprep.inf file based on the HAL type

Call UpdateSysprepinf ()

' Done, quit.

WScript.Quit

Sub UpdateSysprepinf ()

' Set Sysprep Path

If oFSO.FileExists("C:\sysprep\Sysprep.inf") then

sSysprepInf = "C:\sysprep\Sysprep.inf"
oLogging.CreateEntry "Found sysprep in " & sSysprepInf, LogTypeInfo

Else

oLogging.CreateEntry "Could not locate Sysprep", LogTypeWarning

End if

' Find out the HAL type

sHalType = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID")

If sHalType(0) = "acpiapic" Then

if oShell.Environment.item("NUMBER_OF_PROCESSORS") = 1 then

WriteIni sSysprepInf, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_UP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()

else
writeini sSysprepInf, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_MP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()

end if

ElseIf sHalType(0) = "acpiapic_up" Then

WriteIni sSysprepInf, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_UP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()


ElseIf sHalType(0) = "acpiapic_mp" Then

writeini sSysprepInf, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:\Windows\Inf\Hal.inf"
oLogging.CreateEntry "HAL Type is ACPIAPIC_MP, updating sysprep.inf", LogTypeInfo

Call CopyHalFiles()

Else

oLogging.CreateEntry "HAL Type is ACPIPIC, Do nothing", LogTypeInfo

End if


End Sub

Sub CopyHalFiles()


sSourceFolder = "C:\Drivers\UniProcHAL"
sDestinationFolder = "C:\Windows\System32"

oLogging.CreateEntry "Checking for" & sSourceFolder, LogTypeInfo

If oFSO.FolderExists(sSourceFolder) then

oLogging.CreateEntry "Folder " & sSourceFolder & " Found", LogTypeInfo
oLogging.CreateEntry "Copying HAL files for UniProc and MultiProc Comatibility", LogTypeInfo

For Each sFile In oFSO.GetFolder(sSourceFolder).Files

oFSO.GetFile(sFile).Copy sDestinationFolder & "\" & oFSO.GetFileName(sFile),True
oLogging.CreateEntry "Copying " & oFSO.GetFileName(sFile) & " to " & sDestinationFolder, LogTypeInfo

Next

Else
oLogging.CreateEntry "Error - Folder " & sSourceFolder & " Not Found", LogTypeError
oLogging.CreateEntry "Error - Copying HAL files for UniProc and MultiProc Comatibility Failed ", LogTypeError

CopyHalFiles = Failure
Exit Sub
End If


End Sub


Function ReadIni(file, section, item)

ReadIni = ""
file = Trim(file)
item = Trim(item)
Set ini = oFSO.OpenTextFile( file, 1, True)

Do While ini.AtEndOfStream = False
line = ini.ReadLine
line = Trim(line)
If LCase(line) = "[" & LCase(section) & "]" Then
line = ini.ReadLine
line = Trim(line)
Do While Left( line, 1) <> "["
'If InStr( 1, line, item & "=", 1) = 1 Then
equalpos = InStr(1, line, "=", 1 )
If equalpos > 0 Then
leftstring = Left(line, equalpos - 1 )
leftstring = Trim(leftstring)
If LCase(leftstring) = LCase(item) Then
ReadIni = Mid( line, equalpos + 1 )
ReadIni = Trim(ReadIni)
Exit Do
End If
End If

If ini.AtEndOfStream Then Exit Do
line = ini.ReadLine
line = Trim(line)
Loop
Exit Do
End If
Loop
ini.Close

End Function

Sub WriteIni( file, section, item, myvalue )

in_section = False
section_exists = False
item_exists = ( ReadIni( file, section, item ) <> "" )
wrote = False
file = Trim(file)
itemtrimmed = Trim(item)
myvalue = Trim(myvalue)

temp_ini = oFSO.GetParentFolderName(file) & "\" & oFSO.GetTempName

Set read_ini = oFSO.OpenTextFile( file, 1, True, TristateFalse )
Set write_ini = oFSO.CreateTextFile( temp_ini, False)

While read_ini.AtEndOfStream = False
line = read_ini.ReadLine
linetrimmed = Trim(line)
If wrote = False Then
If LCase(line) = "[" & LCase(section) & "]" Then
section_exists = True
in_section = True
ElseIf InStr( line, "[" ) = 1 Then
in_section = False
End If
End If

If in_section Then
If item_exists = False Then
write_ini.WriteLine line
write_ini.WriteLine item & "=" & myvalue
wrote = True
in_section = False
Else
equalpos = InStr(1, line, "=", 1 )
If equalpos > 0 Then
leftstring = Left(line, equalpos - 1 )
leftstring = Trim(leftstring)
If LCase(leftstring) = LCase(item) Then
write_ini.WriteLine itemtrimmed & "=" & myvalue
wrote = True
in_section = False
End If
End If
If Not wrote Then
write_ini.WriteLine line
End If
End If
Else
write_ini.WriteLine line
End If
Wend

If section_exists = False Then ' section doesn't exist
write_ini.WriteLine
write_ini.WriteLine "[" & section & "]"
write_ini.WriteLine itemtrimmed & "=" & myvalue
End If

read_ini.Close
write_ini.Close
If oFSO.FileExists(file) then
oFSO.DeleteFile file, True
End if
oFSO.CopyFile temp_ini, file, true
oFSO.DeleteFile temp_ini, True

End Sub

</script>
</job>

Edited by Tripredacus
codebox to code :p
Link to comment
Share on other sites

In our production enviroment we uses an in house developed four step method:

0. Operating system and mui

1. Hotfixes/patches and apps

2. Gui Adjustments

3. Defrag and sysprep

for each of these steps we take a new image, therefore it's wery rare that we do a new 0 image. Uasally we just load that up from disk, and goes into step one, adds the last months uppdates, patches and changed apps. Step two is mostly automated but some GUI tweaks requiers manual adjustments, therefore we have a checklist for that, Step three is fully auto with the exption of adjusting sysprep inf for new massstorage controllers. This gives us very stable "fat" images containing everything an ordinary user requires to start working.

Doing this the scripted way takes about 6-7 Hours, With imaging it taks 30 min to reinstall a PC. This means that we don't do deeper troubleshoting of software problems anymore. Helpdesk uses 15 max to try and fix it, if they can't they reinstall the PC remotly or asks the user to press F12 to start the reinstallation manually. A coffeebreak (about 30 min) later he/she has a working machine again. If you compare that with dispatching a tech and in worst case having the box replaced, imaging saves time for the users and lowers our operating costs. Especially if you have many offices and don't have local techs on all locations

Sure it takes some time to maintain the images but with 19K boxes it's sufficient to save a few minutes/a box to pay for the image handeling time. The rest is a bonus.

Nice to see that you can do an install in just 30minutes. Maybe you could make a tutorial of what consists those 4 steps you're using. Leave out your production settings and make it in an universal way.

Link to comment
Share on other sites

  • 8 months later...
I don't know about anyone else but I use the following script. It runs after the WIM has been copied to C:\ and updates sysprep.inf with the information for the appropiate HAL. So far it hasn't failed me yet.

'On Error Resume Next

Set objWshShell = CreateObject("WScript.Shell")

Set objFSO = CreateObject("Scripting.FileSystemObject")

' Activate the partition

Call ActivateDisk()

' Customize the local sysprep.inf file based on the HAL type

Call UpdateSysprepinf ()

' Done, quit.

WScript.Quit

Sub ActivateDisk()

' Wait a few seconds, assign drive letter and activate

wscript.sleep 5000

cmd = "cmd /c diskpart.exe /s Activate.txt"

rc = objWshShell.run(cmd, 6, 1)

......

How can I use this script in MS ConfigMgr 2007?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...