Re: Stand Alone Driverpack utility for all OS (XP, 2k3, 2k8, Vista, Win7)
Updated first post to new v120215
Not all heroes wear capes, some wear Kevlar!
You are not logged in. Please login or register.
DriverPacks.net Forum » Windows 7 tools » Stand Alone Driverpack utility for all OS (XP, 2k3, 2k8, Vista, Win7)
Updated first post to new v120215
Yes, this is a known problem. The script can't delete the C:\D directory while the script is running. Very annoying.
I'll probably add a runonce registry edit to delete it on the next reboot instead.
Hi there,
So I'm trying to do the above, I'm running the driver packs install utility from the setupcomplete.cmd on first log on after imaging, and it's working perfectly! Thanks!
But I'd just like to delete that D folder. I made a script to do it, and was trying to get it to run on next restart by runonce added to registry after DPinstall, but it was not working. So then I thought, well it doesn't need to run next next logon, just once the DPinstall has finished.
So this is what I did.
To the DPinstall tool script I added this:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:Done
popd
endlocal
shutdown -r -c "Drivers Installed! Machine will now restart.."
START C:\Drivers\SAD2-111118\RemoveD.cmd
EXIT
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
You don't need the restart there, I just have it so that all drivers finish successfully unattended. I have 3 auto admin logons from my unattend.xml.
So that calls the \RemoveD.cmd to start, then closes the DPinstalltool.cmd.
And this is the \RemoveD.cmd:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ECHO OFF
SLEEP.exe 5
rd /s/q C:\D
DEL /F /S /Q /A "C:\Drivers\SAD2-111118"
rd /s/q C:\Drivers\SAD2-111118
DEL /s /q C"\Drivers\Sleep.exe
EXIT
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I don't know if the sleep.exe was totally required but I wanted it in there to give enough time for DPinstalltool to finish. You can download it from here:
http://www.computerhope.com/dutil.htm
This will also delete any files in the SAD2 location, although the folders will remain. But then the last line will erase the folder too, and sleep.exe.
All that's left is the RemoveD.cmd. But you could put it and sleep into C:\Windows if you wanted, just change all of the paths.
Last edited by andyroo54 (2012-02-23 16:30:57)
Thanks. I already have a cleanup.cmd script in my working file but I haven't had time to work on this lately.
My script uses the same runonce registry key hack that the DriverPacks Finisher uses to clear the directory on next restart so sleep.exe isn't needed.
Hopefully I'll have time in the next few weeks to finish everything on my to-do list and put out a "final" version.
Far Out!
Win 8 to be release as beta (consumer preview) February 29th.
Last edited by TechDud (2012-02-24 02:35:12)
Feb 29 will also see release of .NET Framework 4.5 beta and Visual Studio betas
Just in case anyone is interested, I'm working on adding code to the SAD batch file to delete the folders not needed for certain OS types. As an example, if you're running SAD2 on a Vista OS, then this is what would happen:
1) extract drivers to the system drive
2) delete the folders not needed (Server & Win7 folders) so all that remains is the \All & \Vista folders (or folders from older packs).
3) dpinst is executed.
This should speed things up since dpinst wouldn't have to scan irrelevant driver folders. It would also be optional, just like the new KTD option.
Since I don't have server 2008 installed, I don't know what the registry keys are that identify it. I'll have to install server 2k8 in a VM just to look at the registry.
*Edit
Got it.
FOR /F "tokens=2*" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v InstallationType') DO SET installtype=%%B
Responses would be either "client" or "server". Easy.
Updated first post for v120317.
Hi
Forgive my stupidity but I do not understand where the commands cleanup.cmd and dpfinisher.exe and from what they are called ?
That's because I haven't put cleanup.cmd in yet. I'm still testing it.
DriverPacks Finisher is only activated on an XP install (for now).
First of all, congrats for the awesome script you built...i took some ideas and incorporated some parts to my own installations scripts...some notes about it.
Known problems:
*Script will give error at end when deleting the C:\D directory because a file is in use. (error is harmless).
To fix this issue, you just need to change
ECHO Now cleaning up...
cd %SYSTEMDRIVE%
to
ECHO Now cleaning up...
cd %SYSTEMDRIVE%
cd \
Second thing...the /Separate flag is not supported on a x64 environment...dont really see an issue with using it, but anyway.
Now a question to everyone that uses this...what are your results when using the /high or /realtime flag when expanding the archives?
I barely see an improvement, I tested with 7zip (9.20), is the beta version faster?
Welcome to DriverPacks!
mr_smartepants wrote:Known problems:
*Script will give error at end when deleting the C:\D directory because a file is in use. (error is harmless).To fix this issue, you just need to change
ECHO Now cleaning up... cd %SYSTEMDRIVE%
to
ECHO Now cleaning up... cd %SYSTEMDRIVE% cd \
<Forehead slap>
Of course! Thanks. How the h*ll did I miss that? I'll make the change right away.
Take all the code you want, we'll make more! (Jay Leno/Doritos rimshot!)
For the 7zip switches, some of those are hold-overs from the previous version. We wanted to make this compatible down to XP level, so keeping them doesn't harm anything.
First post updated with v120326
first, thanks mr_smartepants for the great script.
I think it will help me a lot in the next months deploying win7 to several different hardware configurations.
I miss only one "feature" (or perhaps i did not found it yet):
It is possible to install the drivers directly (method 1) from a network source ? (without copying it first to the systemdrive) ?
My hope is that it will be a little bi faster and save some bandwith.
And how can i procced if i will add drivers (OEM specific) manually (method 1&2)?
#EDIT#
In option that the script check if the client is a laptop/desktop would be nice too.
So some packages does not need to coped (e.g. Desktop need to Mobile Graphics, WLAN, Touchpad / Laptop need no Graphics A/B) -> More bandwidth too save
Last edited by jayphizzle (2012-04-02 21:38:32)
Hmm. It's possible. I'd have to do some testing.
Maybe I'll put it on my "to do" list.
I don't know how you'd do your second option. How would the script know what machine it's running on? I'm not going to have it scan HWIDs and match a table of known laptops. That would take longer than to copy the files over!
Hmm. It's possible. I'd have to do some testing.
Maybe I'll put it on my "to do" list.
Would be great
I don't know how you'd do your second option. How would the script know what machine it's running on? I'm not going to have it scan HWIDs and match a table of known laptops. That would take longer than to copy the files over!
Ok i thougt there is an registry entrie or something like this.
We use small script with identifiy the hardware typ.
FOR /F "tokens=2 delims==" %%A IN ('WMIC csproduct GET Name /VALUE ^| FIND /I "Name="') DO SET HWType=%%A
ECHO Computer model: "%HWType%"
GOTO %HWType%
:RETURN
GOTO CONTINUE
With the identified typ e.g. HPCompaq8000EliteSFFPC the related driver installation will be started.
:HPCompaq8000EliteSFFPC
SET LAPTOP=NO
call s:\Driver\Win7\%HWType%\32\8000E.bat
GOTO CONTINUE
Sure this can not be used in your script, the hardware list will be too long.
But perhaps i can change your script for my needs.
Where can i configure that the script only extract the DP's X Y & Z and not all placed in the related folders ?
(Then i can create one for laptops and one for desktops)
Thanks in advance & Happy Easter holidays!
...look for the presence of a battery to detect a portable, perhaps?
...look for the presence of a battery to detect a portable, perhaps?
I had the same idea, but did not found any command to check that.
Would that not exist as an ACPI device in the Device Manager; presumably existing as a 'ghost driver' when not present? Some systems may have two (or more?) installed, sometimes incorrectly. When present, the battery might be accessed through I2C. At a minimum, remaining battery capacity should be accessible.
This should help differentiate a note/net book from a UPS-backed desktop system, though. The presence of mobile chipsets may not be enough to fully differentiate mobile & desktop systems. I remember seeing at least one HP desktop with a mobile chipset. I could be wrong, yet there are likely more, especially small-form factor desktops (D'h*ll/Wyse, HP/compaq, etc).
I would share some code with you, if i actually understood the relevant syntax. The day of doing assembly language seems to have long passed me by. (life just hasn't been the same without my copy of Visi-LaundryList)
"... accepted user input and confirmation, have shifted a register; now jump to another location, do a couple of boolean-related subroutines, then return & output a result in binary; hopefully not the Universal Time Code, this time!"
1011010101000011110101010........ *
Last edited by TechDud (2012-04-06 22:33:02)
One other caveat; improper I2C access with the battery could 'brick' it! Reading contents should not have this effect.
I thought it best to make mention of the possibility, though.
I really need to set some time aside to update the finisher... having teenagers really chews up my evenings
Hey everyone,
i found something to identify the hardware typ (notebook/desktop).
Don't know if this can be implemented "easily" into the script.
"ChassisTypes"
http://msdn.microsoft.com/en-us/library … s.85).aspx
In a vbs script it looks like this:
' Get the SMBIOS asset tag from the Win32_SystemEnclosure class
Set objResults = objWMI.InstancesOf("Win32_SystemEnclosure")
bIsLaptop = false
bIsDesktop = false
bIsServer = false
For each objInstance in objResults
If objInstance.ChassisTypes(0) = 12 or objInstance.ChassisTypes(0) = 21 then
' Ignore docking stations
Else
If not IsNull(objInstance.SMBIOSAssetTag) then
sAssetTag = Trim(objInstance.SMBIOSAssetTag)
End if
Select Case objInstance.ChassisTypes(0)
Case "8", "9", "10", "11", "12", "14", "18", "21"
bIsLaptop = true
Case "3", "4", "5", "6", "7", "15", "16"
bIsDesktop = true
Case "23"
bIsServer = true
Case Else
' Do nothing
End Select
End if
Next
For a Desktop it would only select the DriverPacks:
Audio
Chipset
Graphics A&B
LAN
MassStorage
Misc
and for a Laptop all DriverPacks without the Graphics A&B.
very nice!
Virtual environments are detectable, also (ChassisTypes=0 according to comments at end of your link).
edit: dead or dying battery error-trapping (read-only)? http://msdn.microsoft.com/en-us/library … 85%29.aspx
utilizing objWMI.InstancesOf("Win32_PortableBattery") & variables: Availability, BatteryStatus, ConfigManagerErrorCode
Last edited by TechDud (2012-04-11 20:23:59)
When I get some time I'll have to play with this and see if it can be implemented. I'm working on a separate project that seems to be taking all my time.
Thanks!
I'm running into an issue when I'm trying to run the script from a network share. The script sets a default drive letter Z:, but then once the elevate.cmd script runs I get a script error 'Can not find script file "Z:\SAD2-120326\bin\elevate.vbs".'
I did some more experimenting and found it's a UAC timing issue in my virtual Vista. It works if I use your timing script "For /L %%A in (1,1,1)..." for just one second and put that at the end of the elevate.cmd script. Right after "start wscript...". The normal script worked the first time I ran it a few hours ago, but ever since then it's not. Tried moving it to a different share location and even extracting from the download again.
The only thing that fixed it was to add a slight delay after the "start wscript..." to give Vista a little time to popup the UAC prompt so I can elevate the permission to 'cmd.exe'. I don't know if this is something you'd consider adding? Maybe just a 2 second delay or something.
Interesting. Yes, I can see why there'd be a delay from a network share. I'll probably spend some time tweaking the code this weekend.
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.
[ Generated in 0.176 seconds, 12 queries executed ]