nivlacckw Posted October 11, 2006 Share Posted October 11, 2006 About MSD injection.I was wondering if its possible to use Rundll32 Inf installation to install the drivers in the offline registry ? Any thoughs on that?Hi Prozac,Unfortunately this won't work, because the -very- undocumented, but really interesting functions within setupapi can't stray from their -probably- hardcoded reg-roots like HKLM\System\CCS\CriticalDevDB and the services section.I've looked into this idea myself... but I'm not a programmer and I don't work for MS, so my knowledge about setupapi is really limited.BUT... I have some good news concerning MSD injection. Let me tell you what I tried:I had some old image that did not include drivers for a Promise Fasttrak Sata Raid Controller. So I deployed that image from BartPE to such a Raid system, which of course gave me a 00007B bluescreen on first boot.Downloaded MSD to see what files (easy) and reg entries (difficult) were neccessary to inject.injected the cat, dll, inf and sys into the offline image and loaded the offline system-reg to a temp hive of BartPE. injected the most basic CriticalDev and Service key I could create... So no extra reg-parameters for the driver at all! Unloaded the temp-hive, shutdown Bartpe and tried to boot from the Harddisk again expecting it to fail miserably again with a 7B........ That did not happen.... It booted correctly... to my surprise! After my bootup I updated the driver like you would do normally (this can be scripted BTW) and restarted the machine... Booted fine again and there they were in the registry... all the parameters that I would've wanted to install directly from the inf within BartPE, but too difficult for me to write a generic parser for.So what could this mean? It could mean we only have to inject -very- basic entries in the Services and CritDevDB for the image to boot up without real hassle. On first boot when PNP-install should be run we could (re)-install the MSD as a PNP device and after the second boot it will run like it should be, because the correct "difficult" entries would have been installed.Of course I don't have 100's of different MSD devices laying around to test every driver on... but you guys might be able to help me with that. Testing the routine I mean... Anyway, it gives me some hope that this MSD injecting could very well be simpler than I would've thought a few weeks ago.And yeah, it would probably also work by using the MSD drivers that BartPE uses from the CD. But we should (re-)install the -full- driver on first boot properly...CU guysAnybody come across HAL changers from major server vendors back to the NT4 days? There used to be a program for changing HAL online from standard to ACPI years ago.. Link to comment Share on other sites More sharing options...
ForceFed Posted October 15, 2006 Share Posted October 15, 2006 http://rapidshare.de/files/28543938/bootfiles.rar.htmlOnly use this if you know what you're doing!I suggest you use them in a virtual pc or test machine... and read my post about dtecthal.inf carefully.Would you mind sharing that file again? I currently maintain about 30 images and I would really like to get down to one image. The information here has been very useful. Are there any links for further information on your Barts method of swapping HALs and injecting drivers from a share?Thanks! Link to comment Share on other sites More sharing options...
prozac Posted November 3, 2006 Share Posted November 3, 2006 Any news on this topic? Still trying to inject MSD into a offline image without so much sucess Link to comment Share on other sites More sharing options...
Scrapple Posted November 11, 2006 Share Posted November 11, 2006 Hi guys,Thanx for your PM's. Unfortunately I haven't had the time to answer them or even to participate on this thread lately and it will take some time before I will.BTW Deploying Vista is gonna be so different and much more convenient. You can add modules/settings to an imagefile (.WIM) with an MMC. Check out the BDD-2007 on connect. Link to comment Share on other sites More sharing options...
nivlacckw Posted November 12, 2006 Share Posted November 12, 2006 (edited) Hi guys,Thanx for your PM's. Unfortunately I haven't had the time to answer them or even to participate on this thread lately and it will take some time before I will.BTW Deploying Vista is gonna be so different and much more convenient. You can add modules/settings to an imagefile (.WIM) with an MMC. Check out the BDD-2007 on connect.And single HAL for all machine as well..... Edited November 13, 2006 by nivlacckw Link to comment Share on other sites More sharing options...
geo411m Posted April 26, 2007 Share Posted April 26, 2007 http://rapidshare.de/files/28543938/bootfiles.rar.htmlOnly use this if you know what you're doing!I suggest you use them in a virtual pc or test machine... and read my post about dtecthal.inf carefully.does anyone know where i can find these files? Link to comment Share on other sites More sharing options...
dkreifus Posted October 27, 2008 Share Posted October 27, 2008 Hey all, I hate to revive an old dead topic, but this is exactly what I am working.My current setup is that I have a single image that works on all our machines. Lenovo, HP, Dell, desktops or laptops, and for all our different locations.I use Vista PE 2.0 as a Boot CD for all locations. With 1 menu choice, (location), the Boot CD wipes the machine, connects to a network share, drops the image, and adjusts the HAL before rebooting.I use a HAL script developed here: http://www.myitforum.com/articles/47/view.asp?id=8997 by Johan Arwidmark.His newest script is designed for MDT.Anyway...I recently got a Lenovo T400 that doesnt seem to play nice with any HALs. If I use that machine as my image master, and switch the HAL to ACPI PC from ACPI Multiprocessor PC. When I reboot, it just goes to a black screen, and can't load safe mode.Here is the code I use to change the HAL in VistaPE.'//////////////////////////////////////////////////'//'// Script File:'//'// ZTIHalDetect.vbs'//'// This script updates sysprep.inf with correct HAL Type'// The Reference (master) computer should be built from'// an Advanced ACPI computer'//'// Use this script for WIM images (Imagex, OSD, WDS)'//'//////////////////////////////////////////////////Set oWshShell = CreateObject("WScript.Shell")Set oFSO = CreateObject("Scripting.FileSystemObject")' Customize the local sysprep.inf file based on the HAL typeCall UpdateSysprepinf ()' Done, quit.WScript.QuitSub UpdateSysprepinf () ' Find out the HAL type sHalType = oWshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID") If sHalType(0) = "acpiapic" Then if oWshShell.Environment.item("NUMBER_OF_PROCESSORS") = 1 then WriteIni "c:\sysprep\sysprep.inf", "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf" else writeini "c:\sysprep\sysprep.inf", "Unattended", "UpdateHAL", "ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf" end if ElseIf sHalType(0) = "acpiapic_up" Then WriteIni "c:\sysprep\sysprep.inf", "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf" ElseIf sHalType(0) = "acpiapic_mp" Then writeini "c:\sysprep\sysprep.inf", "Unattended", "UpdateHAL", "ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf" End if 'If sHalType(0) = "acpipic" ThenEnd SubFunction 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.CloseEnd FunctionSub 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, TrueEnd SubAnyone have any ideas to help? I'm stumped! Link to comment Share on other sites More sharing options...
secotton Posted October 31, 2008 Share Posted October 31, 2008 I'm in the same boat as you - we just got our first T400 in, and the standard image doesn't boot - it just black screens. Nothing happens at all.I did some quick reading and a few people were saying the new procs in the T400 only like to boot with the ACPI MultiProcessor HAL. One thing that could be done is to force a specific HAL to be used at boot time. This can be done using the KERNEL and HAL switch in the boot.ini. Check out my post at: http://www.msfn.org/board/Increase-Hardwar...359#entry774359 Link to comment Share on other sites More sharing options...
dkreifus Posted October 31, 2008 Share Posted October 31, 2008 Actually, I am just going to use my boot disk to detect the processor, and then drop the hal files into the windows\system32 directory.It seems to work, my final testing starts tomorrow. Link to comment Share on other sites More sharing options...
secotton Posted October 31, 2008 Share Posted October 31, 2008 That should work as well. I just tested this morning using the method I've used, and it worked wonderfully. dkreifus - I'm just wondering how you go about detecting the processor? Link to comment Share on other sites More sharing options...
dkreifus Posted October 31, 2008 Share Posted October 31, 2008 You can use VB script and WMI. I don't know either of those, so I just used batch line.I did a check for %PROCESSOR_IDENTIFIER%. Its a XP variable.if /I "%PROCESSOR_IDENTIFIER%"=="x86 Family 6 Model 23 Stepping 6, GenuineIntel" copy /y X:\Windows\HAL\*.* c:\Windows\System32\I checked it on the T400, another T400 with different build, and a T500. They all had the same result - x86 Family 6 Model 23 Stepping 6, GenuineIntel - So I will take that a Centrino 2. I've looked for a white paper to outline this, with little success.I checked other machines, with no luck. So any new hardware that comes in, I'll just do a similar check, if it has HAL issues like this. Link to comment Share on other sites More sharing options...
sw2000 Posted January 17, 2009 Share Posted January 17, 2009 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 typeCall UpdateSysprepinf ()' Done, quit.WScript.QuitSub UpdateSysprepinf ()' Set Sysprep PathIf oFSO.FileExists("C:\sysprep\Sysprep.inf") thensSysprepInf = "C:\sysprep\Sysprep.inf"oLogging.CreateEntry "Found sysprep in " & sSysprepInf, LogTypeInfoElseoLogging.CreateEntry "Could not locate Sysprep", LogTypeWarningEnd if' Find out the HAL typesHalType = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\0000\HardwareID")If sHalType(0) = "acpiapic" Thenif oShell.Environment.item("NUMBER_OF_PROCESSORS") = 1 thenWriteIni sSysprepInf, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:\Windows\Inf\Hal.inf"oLogging.CreateEntry "HAL Type is ACPIAPIC_UP, updating sysprep.inf", LogTypeInfoCall CopyHalFiles()elsewriteini sSysprepInf, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:\Windows\Inf\Hal.inf"oLogging.CreateEntry "HAL Type is ACPIAPIC_MP, updating sysprep.inf", LogTypeInfoCall CopyHalFiles()end ifElseIf sHalType(0) = "acpiapic_up" ThenWriteIni sSysprepInf, "Unattended", "UpdateUPHAL", "ACPIAPIC_UP,C:\Windows\Inf\Hal.inf"oLogging.CreateEntry "HAL Type is ACPIAPIC_UP, updating sysprep.inf", LogTypeInfoCall CopyHalFiles()ElseIf sHalType(0) = "acpiapic_mp" Thenwriteini sSysprepInf, "Unattended", "UpdateHAL", "ACPIAPIC_MP,C:\Windows\Inf\Hal.inf"oLogging.CreateEntry "HAL Type is ACPIAPIC_MP, updating sysprep.inf", LogTypeInfoCall CopyHalFiles()ElseoLogging.CreateEntry "HAL Type is ACPIPIC, Do nothing", LogTypeInfoEnd ifEnd SubSub CopyHalFiles()sSourceFolder = "C:\Drivers\UniProcHAL"sDestinationFolder = "C:\Windows\System32"oLogging.CreateEntry "Checking for" & sSourceFolder, LogTypeInfoIf oFSO.FolderExists(sSourceFolder) thenoLogging.CreateEntry "Folder " & sSourceFolder & " Found", LogTypeInfooLogging.CreateEntry "Copying HAL files for UniProc and MultiProc Comatibility", LogTypeInfoFor Each sFile In oFSO.GetFolder(sSourceFolder).FilesoFSO.GetFile(sFile).Copy sDestinationFolder & "\" & oFSO.GetFileName(sFile),TrueoLogging.CreateEntry "Copying " & oFSO.GetFileName(sFile) & " to " & sDestinationFolder, LogTypeInfoNextElseoLogging.CreateEntry "Error - Folder " & sSourceFolder & " Not Found", LogTypeErroroLogging.CreateEntry "Error - Copying HAL files for UniProc and MultiProc Comatibility Failed ", LogTypeErrorCopyHalFiles = FailureExit SubEnd IfEnd SubFunction ReadIni(file, section, item)ReadIni = ""file = Trim(file)item = Trim(item)Set ini = oFSO.OpenTextFile( file, 1, True)Do While ini.AtEndOfStream = Falseline = ini.ReadLineline = Trim(line)If LCase(line) = "[" & LCase(section) & "]" Thenline = ini.ReadLineline = Trim(line)Do While Left( line, 1) <> "["'If InStr( 1, line, item & "=", 1) = 1 Thenequalpos = InStr(1, line, "=", 1 )If equalpos > 0 Thenleftstring = Left(line, equalpos - 1 )leftstring = Trim(leftstring)If LCase(leftstring) = LCase(item) ThenReadIni = Mid( line, equalpos + 1 )ReadIni = Trim(ReadIni)Exit DoEnd IfEnd IfIf ini.AtEndOfStream Then Exit Doline = ini.ReadLineline = Trim(line)LoopExit DoEnd IfLoopini.CloseEnd FunctionSub WriteIni( file, section, item, myvalue )in_section = Falsesection_exists = Falseitem_exists = ( ReadIni( file, section, item ) <> "" )wrote = Falsefile = Trim(file)itemtrimmed = Trim(item)myvalue = Trim(myvalue)temp_ini = oFSO.GetParentFolderName(file) & "\" & oFSO.GetTempNameSet read_ini = oFSO.OpenTextFile( file, 1, True, TristateFalse )Set write_ini = oFSO.CreateTextFile( temp_ini, False)While read_ini.AtEndOfStream = Falseline = read_ini.ReadLinelinetrimmed = Trim(line)If wrote = False ThenIf LCase(line) = "[" & LCase(section) & "]" Thensection_exists = Truein_section = TrueElseIf InStr( line, "[" ) = 1 Thenin_section = FalseEnd IfEnd IfIf in_section ThenIf item_exists = False Thenwrite_ini.WriteLine linewrite_ini.WriteLine item & "=" & myvaluewrote = Truein_section = FalseElseequalpos = InStr(1, line, "=", 1 )If equalpos > 0 Thenleftstring = Left(line, equalpos - 1 )leftstring = Trim(leftstring)If LCase(leftstring) = LCase(item) Thenwrite_ini.WriteLine itemtrimmed & "=" & myvaluewrote = Truein_section = FalseEnd IfEnd IfIf Not wrote Thenwrite_ini.WriteLine lineEnd IfEnd IfElsewrite_ini.WriteLine lineEnd IfWendIf section_exists = False Then ' section doesn't existwrite_ini.WriteLinewrite_ini.WriteLine "[" & section & "]"write_ini.WriteLine itemtrimmed & "=" & myvalueEnd Ifread_ini.Closewrite_ini.CloseIf oFSO.FileExists(file) thenoFSO.DeleteFile file, TrueEnd ifoFSO.CopyFile temp_ini, file, trueoFSO.DeleteFile temp_ini, TrueEnd Sub</script></job> Link to comment Share on other sites More sharing options...
chew118 Posted January 22, 2009 Share Posted January 22, 2009 HiI am new to this forum. Found this thread after google on MSDINST.exe. I have found some steps on the net but somehow wasnt success to inject mass storage driver into an XP image. I need some help and will write down a simple step of my testing with the following example.1) I have a new laptop HP NC6400 2) I load it with Lenovo T61 XP image with its own set of drivers3) I boot it up and it is fine. I check msinfo32 and got a listed of incompatible drivers and one of them is Mass Storage Drivers.4) So following the step I reboot the machine and boot up with WinPE5) Copy all related INF to C:\windows\INF and other SYS and CAT or PNF to C:\windows\systems32\drivers\6) Create sysprep.inf file with the PNP ID = the location of the INF / SYS file6) Run MSDINST.exe sysprep.inf c:\windows7) It says successful 8) Reboot the machine as normal and load Windows.9) Check on msinfo32 I still found Mass Storage Driver is still a problem component.Anything I do wrong. Previous posting in this forum mentioned something about changing the registry. which I have no idea what is all that about.Appreciate your help 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