Scrapple Posted July 16, 2005 Share Posted July 16, 2005 (edited) Now I need to be able to figure out if hyperthreading is enabled, and I can use 1 image for all PCs...<{POST_SNAPBACK}>This should be possible with ta.exe that's included as a dos command tool with windows xp embedded.When you run it, it will create a report file (devices.pmq) with the HAL-type that SHOULD actually be installed (which is not necessarily the one that IS installed) Here's a code snippet that should be run (instead of setup.exe) at first boot of the deployed pc. As you may understand that reg setting was saved (sysprep.reg) and changed just after "sysprep -mini -quiet -reseal -noreboot" and before you shut the master-pc down.--------------sethal.cmd-------------------ta.exefind "ACPIPIC_UP" devices.pmq && SET ACPI=ACPIPIC_UPfind "ACPIAPIC_UP" devices.pmq && SET ACPI=ACPIAPIC_UPfind "ACPIAPIC_MP" devices.pmq && SET ACPI=ACPIAPIC_MPfind "MPS_UP" devices.pmq && SET ACPI=MPS_UPfind "MPS_MP" devices.pmq && SET ACPI=MPS_MPfind "E_ISA_UP" devices.pmq && SET ACPI=E_ISA_UPfind "SYSPRO_MP" devices.pmq && SET ACPI=SYSPRO_MP_UPrundll32.exe setupapi,InstallHinfSection %ACPI%_HAL 131 %windir%\inf\hal.infreg delete HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /freg delete HKLM\SYSTEM\ControlSet001\Enum\Root\PCI_HAL\0000 /freg import c:\sysprep\sysprep.regexit---------------sethal.cmd----------------------------O, I forgot; Your HAL should be set to "Standard HAL" on the master-pc beforehand.-This should pretty much work on ANY pc/laptop that can run XP-Remember: This is NOT supported by M$. Edited July 16, 2005 by Scrapple Link to comment Share on other sites More sharing options...
fly Posted July 18, 2005 Share Posted July 18, 2005 (edited) Now I need to be able to figure out if hyperthreading is enabled, and I can use 1 image for all PCs...<{POST_SNAPBACK}>This should be possible with ta.exe that's included as a dos command tool with windows xp embedded.When you run it, it will create a report file (devices.pmq) with the HAL-type that SHOULD actually be installed (which is not necessarily the one that IS installed) Here's a code snippet that should be run (instead of setup.exe) at first boot of the deployed pc. As you may understand that reg setting was saved (sysprep.reg) and changed just after "sysprep -mini -quiet -reseal -noreboot" and before you shut the master-pc down.O, I forgot; Your HAL should be set to "Standard HAL" on the master-pc beforehand.-This should pretty much work on ANY pc/laptop that can run XP-Remember: This is NOT supported by M$.<{POST_SNAPBACK}>I'm not sure I follow what you're doing there. Can you explain further?edit: Let me elaborate. What is in the sysprep.reg file? And where to I get ta.exe? Edited July 18, 2005 by fly Link to comment Share on other sites More sharing options...
Scrapple Posted July 19, 2005 Share Posted July 19, 2005 I'm not sure I follow what you're doing there. Can you explain further?edit: Let me elaborate. What is in the sysprep.reg file? And where to I get ta.exe?Hi, here's some additional code...Hope this explains it better. :-)--------runprep.cmd-------rem Run sysprep, but no reboot!!!start /wait c:\sysprep\sysprep.exe -mini -reseal -quiet -norebootrem Save sysprep's boot-setup reg-entry (for later import from sethal.cmd)...reg export HKLM\system\setup c:\sysprep\sysprep.regrem ...and change it, so my detection and hal-swap runs first.REG ADD HKLM\SYSTEM\Setup /v CmdLine /t REG_MULTI_SZ /d "%SystemDrive%\sysprep\sethal.cmd" /frem Shutdown and ghost the partition/disk.shutdown------------------------------BTW, ta.exe comes with "Windows xp-embedded"=XPE. Link to comment Share on other sites More sharing options...
fly Posted July 19, 2005 Share Posted July 19, 2005 Very interesting.Here is what I ended up doing...This script is called by GUIRunOnceOption Explicit' Set variablesDim oShell, oFSODim sOutputFile, aBiosString, iBiosRecords, sCurBiosString, sAPICDim sUniArray, sMultiArray, sModel' Setup arrays' sUniArray is for Dell models with a Uniprocessor' sMultiArray is for Dell models with a Multiprocessor (Hyperthreading included)sUniArray = array("GX260")sMultiArray = array("GX270", "GX280")'**Start Encode**' The line above exists if there is a desire to encode the script for security reasons.' To encode the script, download the script encoder via the link below.' http://www.msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.aspSet oShell = WScript.CreateObject("WScript.Shell")Set oFSO = CreateObject("Scripting.FileSystemObject")' Set our APIC value to initially be falsesAPIC = False' Run SMBios to find settingssOutputFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\Bios.TXT"oShell.Run "CMD.Exe /C c:\tcs\sysprep\SMBiosD.Exe > " & sOutputFile,0,True' Read temp file into an ArrayaBiosString = Split(UCase(oFSO.OpenTextFile(sOutputFile,1,False).ReadAll),vbCrlf)iBiosRecords = CStr(UBound(aBiosString)+1)' Delete temp fileoFSO.DeleteFile sOutputFile' Find the exception we're looking for (Uniprocessor)For Each sModel in sUniArray For Each sCurBiosString in aBiosString If Instr(1,Ucase(sCurBiosString),sModel,vbBinaryCompare) <> 0 Then sAPIC = "Uni" Exit For End If NextNext' Find the exception we're looking for (Multiprocessor)For Each sModel in sMultiArray For Each sCurBiosString in aBiosString If Instr(1,Ucase(sCurBiosString),sModel,vbBinaryCompare) <> 0 Then sAPIC = "Multi" Exit For End If NextNext' Do stuff with resultsIf sAPIC = "Uni" Then oShell.Run "C:\tcs\sysprep\DevCon sethwid @ROOT\ACPI_HAL\0000 := +acpiapic_up !acpiapic_mp",1, True oShell.Run "C:\tcs\sysprep\DevCon update c:\windows\inf\hal.inf acpiapic_up",1, TrueElseIf sAPIC = "Multi" Then oShell.Run "C:\tcs\sysprep\DevCon sethwid @ROOT\ACPI_HAL\0000 := +acpiapic_mp !acpiapic_up",1, True oShell.Run "C:\tcs\sysprep\DevCon update c:\windows\inf\hal.inf acpiapic_mp",1, TrueEnd Ifwscript.quitI barely know how to script anything, so the code probably looks horrible. But thanks to this thread, I now have only ONE image to maintain for all my PCs. Link to comment Share on other sites More sharing options...
fly Posted March 5, 2007 Share Posted March 5, 2007 If anyone else is interested, I have updated this script.''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' File: HAL.vbs' Created: 08/11/05' Updated: 03/05/07' Version: 1.1' Author: Zac Holmes'' Purpose: This script is designed to run at the end of the Sysprep process.' It updates the HAL from a standard ACPI HALL to either a ' Uniprocessor or Multiprocessor HAL, based on number of processors.'' Prereqs: This script requires the following executables:' devcon.exe (See http://support.microsoft.com/kb/311272)''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''**Start Encode**' The line above exists if there is a desire to encode the script for security reasons.' To encode the script, download the script encoder via the link below.' http://www.msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.aspOption Explicit' Declare the vars!Dim objShell, objFSO, strProcs' I Object to this!Set objShell = CreateObject("WScript.Shell")Set objFSO = CreateObject("Scripting.FileSystemObject")' Get number of processorsstrProcs = objShell.ExpandEnvironmentStrings("%NUMBER_OF_PROCESSORS%")' Do stuff with resultsIf strProcs = "1" Then 'For ACPI Uniprocessor objShell.Run "DevCon.exe sethwid @ROOT\ACPI_HAL000 := +acpiapic_up !acpiapic_mp", 0, True objShell.Run "DevCon.exe update c:\windows\inf\hal.inf acpiapic_up", 0, TrueElse 'For ACPI Multiprocessor objShell.Run "DevCon.exe sethwid @ROOT\ACPI_HAL000 := +acpiapic_mp !acpiapic_up", 0, True objShell.Run "DevCon.exe update c:\windows\inf\hal.inf acpiapic_mp", 0, True'Else 'for standard ACPI HAL' objShell.Run "C:\tcs\sysprep\DevCon sethwid @ROOT\ACPI_HAL000 := +acpipic_up !acpiapic_mp",0, True' objShell.Run "C:\tcs\sysprep\DevCon update c:\windows\inf\hal.inf acpipic_up",0, TrueEnd If' Clean up and dieSet objShell = NothingSet objFSO = NothingWscript.Quit Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now