Jump to content

Online driver Installer can be run during windows installation process


RicaNeaga

Recommended Posts

I'm talking about the new online drivers installer found in 1.4.0, with the features described by ricktendo here.

Why would anyone need it? What are the advantages over integrating the drivers with DISM?

1. This would make an AIO driver + windows 7 ISO truly possible, making the probability of conflicts even lower (the example of the AMD PCIE filter chipset driver installing on Intel-based systems comes to mind);

2. On the system only the needed drivers are installed and copied to drive C:, so a balast content with other drivers will be avoided;

3. Useful for a novice user, that doesn't have to hand-pick the needed drivers, but can ''integrate'' hundreds of them without any other worry.

After months of work (not continuous work, of course), I'm finalizing a pack of ONLY-windows-7 drivers, based on the driverpacks - heavily updated and more organised. And with such a powerful tool, the usefulness of such a pack will be even greater - people will not have to hand-pick their drivers and just integrate all the folder. Such a behaviour is unfortunately also common now with W7T users for integrating the current driverpacks, and this is not a very good idea.

So I don't know if this is doable, and to be more precise if this utility can be run before the second phase of windows installation starts. It has to because that's when the windows installation process starts to look for the (microsoft integrated) drivers needed. And this is just exaclty what the great driverpacks integrating tool can do ONLY for windows xp.

I also hope ricktendo and Kelsenellenelvian will comment on this one. :)

Link to comment
Share on other sites

Why would anyone need it? What are the advantages over integrating the drivers with DISM?

Simply answer really, someone requested it so i added it. As rick said it lets you remove outdated drivers also.

Problem is i don't know the difference between Windows 7 and Windows Vista drivers, surely there's something different in the inf file?

Edited by Legolash2o
Link to comment
Share on other sites

Legolash, I don't understand what you're saying. I'm not requesting what ricktendo already has requested, I'm requesting that somehow through W7T, the Online driver installer to be integrated into an offline image (alongside maybe a user-generated driver pack / folder), and run before the second phase of windows installation starts.

About the second question, it depends - sometimes there is a mention in the .inf (like a NTamd64 6.1 for windows x64 drivers, or a NTx86 6.1 for 7 x86, or even a clear mention in the beginning - windows 7 driver), sometimes it isn't and you have to manually download the individual drivers from the producer's support site (like I already did for many).

But this isn't the issue since I'll make public this pack very soon (I'm now trying to set up a ftp-like solution, and if I can't, I'm going for the usual mediafire option). The problem is how this tool can be run before the second phase of windows installation starts. And this is where I hope ricktendo / Kelsenellenelvian will help a little. Or maybe even someone from driverpacks, since a similar solution is implemented in their driver installer tool for windows xp (DriverPacks BASE).

Link to comment
Share on other sites

I won't interfere anymore with this discussion, since I don't know how to implement my request, but once again I remind you that there is a similar working solution for XP only, that does exactly this (the app runs before the second phase of windows xp install process) - Driverpacks BASE.

Edited by RicaNeaga
Link to comment
Share on other sites

If the only solution is to run it at first logon, with the other switchless installers, then it's ok. I would have preffered it to give that drivers to the windows installation process during the second phase, but better this then nothing. :)

Link to comment
Share on other sites

Again, Online Drivers does not work with wim images, it works on the currently installed OS, there isn't a second phase if Windows is already installed. It will probably not benefit the installation at all apart from slow it down.

Online Driver Installer does not even use dism, it uses pnptuil :)

Edited by Legolash2o
Link to comment
Share on other sites

I understand that. I was asking you to make (smth like) a silent installer, that runs this online drivers app automatically (for ex.) at first logon (as the rest of the silent installers, like ricktendo's .net4), and installs only the needed drivers from a batch folder of hundreds of drivers.

I already mentioned the advantages in the first post, as an alternative to the DISM way of installing drivers.

Please don't be mad because I insist on this feature - I really consider it CLEARLY SUPERIOR to DISM integrating of drivers especially for novice users. Hope you'll consider solving my request at some time in the future :)

Link to comment
Share on other sites

Great! I have four suggestions:

1. The name of that folder maybe shouldn't be so common - a Drivers folder is also in windows directory; a ''W7TDrivers'' folder name (that a user can copy to the usb root, or make another ISO and include it) I think will be more appropriate;

2. An option in the ISO Maker that isn't checked by default, to also add/copy the ''W7TDrivers'' folder to the root of the iso;

3. Make the the implicit and only option that pnptuil only installs the needed (found on the system) drivers; if advanced users, that aren't interested in saving HDD/SSD space and for other reasones, want to have an AIO disk, with all the drivers on the planet integrated, then DISM can already do that for them. :)

4. An option to also delete all the not-present-on-the-machine / not-needed-drivers Microsoft drivers (if it is doable), to further save HDD/SSD space; but I don't know if this will have the potential for potential failures (bluescreens etc) afterwards... in case other hardware is added to the system. For non-important drivers (chipset, mass storage, usb), such a risk I think will be very close to 0.

LE: and a fifth suggestion - please recheck Mr. ricktendo's post from this thread.... maybe will help :)

Edited by RicaNeaga
Link to comment
Share on other sites

@RicaNeaga, have you had a chance to check out the SAD2 script I mentioned earlier?

One way to handle this would be to only integrate the most urgent drivers then use mr_smartepants' SAD2 script - http://forum.driverp...pic.php?id=5336 to install the rest of the required drivers.

Since you're now talking about adding the drivers at first logon, I was wondering how you thought the script's actions compared with what you were wanting to accomplish?

Cheers and Regards

Link to comment
Share on other sites

That script is driverpacks-folder tyed. It's like saing ''Hey, Apple has an alternative to Flash''. It's just my take on this, my opinion. :)

And I really don't like the current way driverpacks for windows 7 looks like. That's why I ''wasted'' so much time updating it / making it windows 7 - only / adding drivers to it... :)

Link to comment
Share on other sites

I think the SAD2 solution would be the best solution and easy to implement with setupcomplete.cmd

All you have to do is to copy the DPs into the image and setup the script to run at first logon. A window with the progress would be handy here.

~ 800 MB of drivers will fit along with the setup files on a DVD5 eventualy, filtering out Chipset and MassStorage that will be integrated into the image

I want this feature implemented if possible.

Link to comment
Share on other sites

What i can do is, if W7TRunOnce detects a "Drivers" folder on any partition/dvd/usb root it will use pnputil to install all the inf files?

I really like where this discussion is going. But to be honest, I don't think either DISM or pnputil will give you the desired result.

See, both are great for removing drivers from either the offline or online OS (respectively), but both will add ALL drivers to the OS whether they're needed or not.

Quote taken from here:http://technet.micro...v=ws.10%29.aspx

Drivers that are located in the path specified by DriverPaths are copied to the driver store ...

So this continues the problem of driverstore bloat. What I use in my SAD2 script is the Microsoft tool dpinst.exe. There are two versions (incompatible with each other) for 32 & 64 bit OS.

Where dpinst excels is that it only installs drivers for the hardware that is present during execution.

About 95% of my script deals with OS detection, path resolution, and driverpack extraction.

The "meat & potatoes" line that gets the drivers loaded is right here:

Start "MicroSoft Driver Installer Tool Running" /wait /separate /realtime /min CMD /C DPInst.exe /c /s

But in order for this to work, dpinst needs to be copied to the root of the folder containing all the drivers.

The line I was experimenting with for pnputil usage was this:

:: pnputil -a -i %SystemDrive%\D\*\*.inf

But again, this loads ALL the detected drivers into the driverstore.

RickNeaga is right though, my script is hard-coded to a specific folder structure. I am working on adding more code to allow for a more flexible folder structure though.

Here's my entire script:

::Except otherwise noted, the open-source code of the DP_Install_Tool.cmd file is © 2011-2012 by Erik Hansen for DriverPacks.net, under a Creative Commons Attribution-ShareAlike license:

http://creativecommo...ses/by-sa/3.0/.

::7-Zip is open source software by Igor Pavlov. Most of the source code is under the GNU LGPL license. The unRAR code is under a mixed license: GNU LGPL + unRAR restrictions. Check license information here: http://www.7-zip.org/license.txt or http://www.gnu.org/licenses/lgpl.html

::DPInst.exe is proprietary code owned completely by Microsoft and distributed under their own license. (see .\bin\*\dpinst-license.rtf)

:: rev 12.03.26

:: Originally written by Jeff Herre AKA OverFlow, significantly rewritten by Erik Hansen AKA Mr_Smartepants.

:: Modified by Brent Newland (casipc.com) to support network shares and UAC elevation

:: A Script to use Microsoft's DPInst.exe with the DriverPacks.

:: Help and Support available at http://forum.driverp...pic.php?id=5336

:: This script assumes that the original folder structure of the downloaded archive remains intact.

:: Please do not alter the folder structure unless you REALLY know what you are doing and alter the below code accordingly.

:: Changelog:

:: v120326

:: Fixed code to prevent errors during cleanup stage (Iceblackice)

:: v120318

:: Added code to enable switches. Only a Help guide and "Silent" operation for now. (Erik Hansen)

:: v120317

:: Added code for silent operation. No prompts, displays progress only. (Erik Hansen)

:: Added code to delete folders not needed. (Erik Hansen)

:: v120217

:: Updated command line 7-zip in \bin folder to 9.22. (Erik Hansen)

:: v120215

:: Added command line 7-zip to \bin folder and code to use. (Erik Hansen)

:: Updated elevate.vbs to current version from MSDN.

:: Optimized OS detection subroutines.

:: Fixed log file output reference to %windir%\dpinst.log.

:: v120203

:: Added code to use native installed 7-Zip IF present. (Erik Hansen)

:: Fixed bug with extra space in %ARCH% variable

:: v111118

:: Fixed typo in log file output reference.(Twig123/Dave)

:: v111009

:: Fixed typo in KTD option code.(Erik Hansen)

:: v111008

:: Added code to allow user to change Keep The Drivers (KTD) option (Erik Hansen)

:: Fixed bug where DriverPacks wouldn't be found IF there were spaces in the path.

:: v110713

:: Fixed code to prevent errors during cleanup stage (Erik Hansen)

:: Added code to report accurate CPU type (Erik Hansen)

:: Added code to detect DP_*.7z files in the current directory (Erik Hansen)

:: v110505

:: Fixed code to prevent writing log to read-only disc (Erik Hansen)

:: Repackaged dpinst* files to prevent accidental deletion. (Erik Hansen)

:: v110504

:: Fixed bug where NT6 Method 1 fails prematurely. (Erik Hansen)

:: v110503

:: Fixed code to remove extra backslash from path if one exists. (Erik Hansen)

:: v110502

:: Fixed un7zip code to allow for wildcard file extraction (Erik Hansen)

:: v110501

:: Updated to support network shares and UAC elevation for NT6 (Brent Newland)

:: Fixed CPU detection to allow for 32-bit OS on 64-bit CPU (Erik Hansen)

:: Fixed un7zip code to allow breakpoints (Brent Newland)

:: v110312 (Erik Hansen)

:: Fixed missing NT5\x86\dpinst.* files

:: Updated to current DriverPack ChipSET versions.

:: v110213 (Erik Hansen)

:: Added NT6 Method 1 functionality.

:: Added check for UNC (\\server\path\to\file) paths. Cmd.exe will fail if UNC path is used.

:: Changed Method 1 COPY function to XCOPY for reliability.

:: Improved readme.txt instructions.

@ECHO off

: Default options

:: Change SILENT option to "Y" if you want to bypass all prompts but make sure the next two options are set to your preferences first.

SET "SILENT=N"

:: KTD option. Default is "N", "Y" will not delete any drivers from the %systemdrive%\D\ folder.

SET "KTD=N"

:: OS folder clean option. Default is "N", "Y" will delete any drivers for OS folders not needed.

SET "CLEAN=N"

: Help options

if "%1"=="/?" goto usage

if "%1"=="/h" goto usage

if "%1"=="/H" goto usage

if "%1"=="/S" SET "SILENT=Y"

::if "%1"=="/K" SET "KTD=Y"

::if "%1"=="/C" SET "CLEAN=Y"

:: Check for network paths, assign temporary drive letter IF found.

SET pd=%~dp0

pushd %~dp0

SET cur=%cd%

:slash

:: Strip all trailing backslash from path. \\ should become \ then nothing.

IF [%cur:~-1%]==[\] SET "cur=%cur:~0,-1%"

IF [%cur:~-1%]==[\] GOTO slash

cls

TITLE DriverPacks.net Stand Alone Driver Updater v2.0 & Color 9f

SET LOG=nul & IF [%1] NEQ [] (IF /I [%1] NEQ [Q] (SET LOG=%1) & IF /I [%1] EQU [V] (SET LOG=CON))

SET msg2=%msg% %username%

:OS-check

FOR /F "tokens=2*" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuildNumber') DO SET build=%%B

FOR /F "tokens=2*" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName') DO SET prodname=%%B

FOR /F "tokens=2*" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v InstallationType') DO SET installtype=%%B

IF /I "%build%"=="2600" SET OSbuild=NT5

FOR %%i IN (6000 6001 6002 7600 7601 7602) DO (

IF /I "%build%"=="%%i" SET OSbuild=NT6

)

SET "OSTYPE=WINXP"

FOR %%i IN (6000 6001 6002) DO (

IF /I "%build%"=="%%i" SET "OSTYPE=VISTA"

)

FOR %%i IN (7600 7601 7602) DO (

IF /I "%build%"=="%%i" SET "OSTYPE=WIN7"

)

IF "%INSTALLTYPE%"=="Server" SET "OSTYPE=SERVER"

ECHO. & ECHO Locating the DriverPacks...

SET "M=0"

IF "%OSbuild%"=="NT6" GOTO Elevate

:PROCESSOR

:: Detect Processor type on running system

SET "ARCH=32"

IF EXIST "%SystemRoot%\SysWOW64" SET "ARCH=64" & GOTO PROCESSOR3

:PROCESSOR2

:: No 64-bit system folders found, must be 32-bit system regardless of processor type

SET "DPLoc=%cur%\%OSbuild%\x86"

GOTO ZipCheck

:PROCESSOR3

:: 64-bit system folders found, must be 64-bit system double-check for x86 processor for error?

SET "DPLoc=%cur%\%OSbuild%\x64"

IF /I "%PROCESSOR_ARCHITECTURE%"=="x86" GOTO Error3

:ZipCheck

SET zip=N

IF EXIST "%programfiles%\7-Zip\7z.exe" (SET "zpath=%programfiles%\7-Zip\7z.exe" & SET "zip=Y" & GOTO ZipFound)

IF EXIST "%cur%\bin\%ARCH%\7z.exe" (SET "zpath=%cur%\bin\%ARCH%\7z.exe" & SET "zip=Y" & GOTO ZipFound)

:ZipFound

IF not EXIST "%zpath%" SET zip=N

:DoubleCheck

::Check for XP-64

IF "%OSbuild%"=="NT5" GOTO Method5

IF "%OSbuild%"=="NT6" GOTO Method6

GOTO Error1

:Method5

::Double check for XP-64

IF /I [%PROCESSOR_ARCHITECTURE%] NEQ [x86] GOTO Error1

IF EXIST "%cur%\D\" (SET "DPLoc=%cur%" & SET "M=1" & GOTO Message2)

IF EXIST "%DPLoc%\D\" (SET "M=1" & GOTO Message2)

IF EXIST "%DPLoc%\DP_*.7z" (SET "M=2" & GOTO Found)

IF EXIST "%cur%\DP_*.7z" (SET "DPLoc=%cur%" & SET "M=2" & GOTO Found)

ECHO Searching Root folders since DriverPacks were not found in current folder...

FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO (

IF EXIST "%%i:\OEM\bin\un7zip.exe" SET "M=2"

IF EXIST "%%i:\$OEM$\$1\D\" (SET "DPLoc=%%i:\$OEM$\$1" & SET "M=1" & %%i)

IF "%M%">="1" GOTO Message2)

ECHO. & ECHO Strange... The DriverPacks were not found in %DPLoc% & ECHO. & Pause & GOTO Done

:Method6

IF "%ARCH%"=="32" SET "ARCHP=X86"

IF "%ARCH%"=="64" SET "ARCHP=X64"

FOR %%i IN (3 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (

IF EXIST "%DPLoc%\%%i\" SET "M=1" & GOTO Message2

)

IF EXIST "%DPLoc%\DP_*.7z" (SET "M=2" & GOTO Found)

ECHO. & ECHO Strange... The DriverPacks were not found in %DPLoc% & ECHO. & Pause & GOTO Done

:Found

IF "%zip%"=="Y" GOTO Message2

IF not EXIST "%cur%\bin\un7zip.exe" GOTO Error2

:Message2

IF "%SILENT%"=="Y" GOTO Lets-GO

::Reset variables to defaults

SET "KTD=N"

SET "CLEAN=N"

cls

SETlocal

ECHO ********************************************************************

ECHO Released under Creative Commons Attribution-ShareAlike license

ECHO %msg2% please read below carefully.

ECHO.

ECHO Operating System Architecture Detected:

ECHO %prodname% %ARCH%-bit on %PROCESSOR_ARCHITECTURE% compatible CPU

ECHO CPU: %PROCESSOR_IDENTIFIER%

ECHO.

ECHO %ARCH%-bit DriverPacks will be installed from

ECHO %DPLoc% using method: %M%

ECHO Native 7-zip command line application found? %zip%

ECHO.

ECHO IF this is NOT intended, exit the program now!

ECHO ********************************************************************

ECHO Do you want to Keep The Drivers (KTD) after install?

ECHO Answer Y/N (Y- will keep all drivers unless deleted manually)

ECHO ********************************************************************

:KTD-option

SET /p option=[Y,N]?

IF "%option%"=="Y" SET "KTD=Y"

IF "%option%"=="y" SET "KTD=Y"

IF "%KTD%"=="Y" ECHO KTD option has been enabled.

:Message3

ECHO.

ECHO ********************************************************************

ECHO Do you want to remove drivers not needed by this OS?

ECHO Answer Y/N (N- will use all drivers from every folder)

ECHO ********************************************************************

:CLEAN-option

SET /p option=[Y,N]?

IF "%option%"=="Y" SET "CLEAN=Y"

IF "%option%"=="y" SET "CLEAN=Y"

IF "%CLEAN%"=="Y" ECHO Unnecessary drivers will be deleted prior to integration.

:Lets-GO

SET DPFL=%SystemDrive%\DPsFnshr.ini

IF NOT EXIST "%SystemDrive%\D\" MD "%SystemDrive%\D\"

:dpinst

IF "%zip%"=="Y" GOTO dpinstNative

ECHO. & ECHO Extracting the DriverPacks %ARCH%-bit core files.

Start /wait /separate /high "" "%cur%\bin\un7zip.exe" "%cur%\bin\%ARCH%\dpinst.7z" %SystemDrive%\D\

GOTO Method1

:dpinstNative

ECHO. & ECHO Extracting the DriverPacks %ARCH%-bit core files using native 7-Zip.

Start /wait /separate /high "" "%zpath%" x "%cur%\bin\%ARCH%\dpinst.7z" -o"%SystemDrive%\D\"

:Method1

IF "%M%"=="1" (

ECHO. & ECHO Preparing the DriverPacks files. Method 1 was found. & ECHO.

IF NOT "%DPLoc%"==%SystemDrive% ECHO Copying Driverpacks files & XCOPY "%DPLoc%\." "%SystemDrive%\D\." /E /H

ECHO [settings] > %DPFL%

ECHO DPsRoot = "%DPLoc%" >> %DPFL%

ECHO DPsRootDel = "false" >> %DPFL%

ECHO debug = "true" >> %DPFL%

CD %DPLoc%\D

)

:Method2

IF "%zip%"=="Y" GOTO Method2Native

IF "%M%"=="2" (

ECHO. & ECHO Preparing the DriverPacks now. Method 2 was found. & ECHO.

ECHO Extracting DriverPacks from: %DPLoc%

for %%f in ("%DPLoc%\DP_*.7z") do Start /wait /separate /high "" "%cur%\bin\un7zip.exe" "%%f" %SystemDrive%\D\

IF "%OSbuild%"=="NT6" GOTO Begin

COPY /Y "%DPLoc%\*.ins" %SystemDrive%\

Start /wait /separate /high "" "%cur%\bin\un7zip.exe" "%cur%\bin\DPsFnshr.7z" %SystemDrive%\

%SystemDrive% & cd %SystemDrive%\D

ECHO [settings] > %DPFL%

ECHO DPsRoot = "%SystemDrive%" >> %DPFL%

ECHO DPsRootDel = "true" >> %DPFL%

ECHO debug = "true" >> %DPFL%

)

GOTO SKIPKTD

:Method2Native

IF "%M%"=="2" (

ECHO. & ECHO Preparing the DriverPacks now. Method 2 was found. & ECHO Using native 7-Zip

ECHO Extracting DriverPacks from: %DPLoc%

for %%f in ("%DPLoc%\DP_*.7z") do Start /wait /separate /high "" "%zpath%" x "%%f" -o"%SystemDrive%\D\"

IF "%OSbuild%"=="NT6" GOTO Begin

COPY /Y "%DPLoc%\*.ins" %SystemDrive%\

Start /wait /separate /high "" "%zpath%" x "%cur%\bin\DPsFnshr.7z" -o"%SystemDrive%\"

%SystemDrive% & cd %SystemDrive%\D

ECHO [settings] > %DPFL%

ECHO DPsRoot = "%SystemDrive%" >> %DPFL%

ECHO DPsRootDel = "true" >> %DPFL%

ECHO debug = "true" >> %DPFL%

)

:SKIPKTD

IF "%KTD%"=="Y" GOTO KEEPKTD

ECHO KTD = "false" >> %DPFL%

ECHO KTDlocation = "%SystemRoot%\DriverPacks" >> %DPFL%

ECHO logLocation = "%SystemRoot%" >> %DPFL%

GOTO Begin

:KEEPKTD

ECHO KTD = "paths:D" >> %DPFL%

ECHO KTDlocation = "%SystemRoot%\DriverPacks" >> %DPFL%

ECHO logLocation = "%SystemRoot%" >> %DPFL%

:Begin

IF "%CLEAN%"=="N" GOTO Begin2

:CLEAN-warn

ECHO OSTYPE is %OSTYPE%

IF "%OSTYPE%"=="SERVER" (

ECHO drivers will be deleted from "%SystemDrive%\D\%ARCHP%\Vista\"

ECHO drivers will be deleted from "%SystemDrive%\D\%ARCHP%\Win7\" )

IF "%OSTYPE%"=="VISTA" (

ECHO drivers will be deleted from "%SystemDrive%\D\%ARCHP%\Server\"

ECHO drivers will be deleted from "%SystemDrive%\D\%ARCHP%\Win7\" )

IF "%OSTYPE%"=="WIN7" (

ECHO drivers will be deleted from "%SystemDrive%\D\%ARCHP%\Server\"

ECHO drivers will be deleted from "%SystemDrive%\D\%ARCHP%\Vista\" )

IF "%SILENT%"=="Y" GOTO CLEAN-folder

ECHO This is your final warning before drivers are deleted from unneeded OS folders.

pause

:CLEAN-folder

IF "%OSTYPE%"=="SERVER" (

RD /S /Q "%SystemDrive%\D\%ARCHP%\Vista\"

RD /S /Q "%SystemDrive%\D\%ARCHP%\Win7\" )

IF "%OSTYPE%"=="VISTA" (

RD /S /Q "%SystemDrive%\D\%ARCHP%\Server\"

RD /S /Q "%SystemDrive%\D\%ARCHP%\Win7\" )

IF "%OSTYPE%"=="WIN7" (

RD /S /Q "%SystemDrive%\D\%ARCHP%\Server\"

RD /S /Q "%SystemDrive%\D\%ARCHP%\Vista\" )

ECHO Excess drivers deleted!

IF "%SILENT%"=="Y" GOTO Begin2

pause

:Begin2

%SystemDrive% & cd %SystemDrive%\D

cls

ECHO *********************************************************************

ECHO.

ECHO. & ECHO.

ECHO Running the MicroSoft Driver Installer now !

ECHO.

ECHO The progress window is minimized to the task bar & ECHO. & ECHO.

ECHO. & ECHO.

ECHO Please wait for the MicroSoft tool to complete its job...

ECHO This may take from 2-30 minutes depending on the speed of this PC.

ECHO.

ECHO *********************************************************************

Start "MicroSoft Driver Installer Tool Running" /wait /separate /realtime /min CMD /C DPInst.exe /c /s

IF "%OSbuild%"=="NT6" GOTO LOG-file

:Finisher

ECHO. & ECHO Running the DriverPacks.net Finisher now! & ECHO.

%SystemDrive% & cd\ & Start /wait /separate /high "" DPsFnshr.exe

:LOG-file

:: Log and Attended output section

IF /I [%1] NEQ [Q] (

IF [LOG] NEQ [nul] (

ECHO. & ECHO Method %M% was found at: >>%LOG%

ECHO %DPLoc% >>%LOG%

ECHO List INF's that were matched with this system >>%LOG%

FOR /F "usebackq tokens=2,3*" %%G IN ('type %windir%\dpinst.log') DO (

IF [%%G]==[successfull] IF [%%H]==[installation] ECHO %%G %%H %%I >>%LOG%)

)

: Final Message

cls

ECHO *********************************************************************

ECHO.

ECHO. & ECHO The DriverPacks Stand Alone Drivers installation is complete!

ECHO. & ECHO The log file of this utility's progress is found in %windir%\dpinst.log

::ECHO & Start /min sndrec32 /play /close %windir%\media\ding.wav

IF "%OSbuild%"=="NT5" GOTO Timer

IF "%KTD%"=="Y" GOTO Timer

ECHO Now cleaning up...

cd %SYSTEMDRIVE%

cd \

IF EXIST "%SYSTEMDRIVE%\D\x86\*" DEL /F /S /Q "%SYSTEMDRIVE%\D\x86\*" >nul

IF EXIST "%SYSTEMDRIVE%\D\x64\*" DEL /F /S /Q "%SYSTEMDRIVE%\D\x64\*" >nul

IF EXIST "%SYSTEMDRIVE%\D\*" DEL /F /S /Q "%SYSTEMDRIVE%\D\*" >nul

IF EXIST "%SYSTEMDRIVE%\DPInst.*" DEL /F /S /Q "%SYSTEMDRIVE%\DPInst.*" >nul

IF EXIST "%SYSTEMDRIVE%\D" RD /S /Q "%SYSTEMDRIVE%\D\" >nul

:Timer

ECHO. & ECHO This window will close itself in 30 seconds... & ECHO.

For /l %%A in (1,1,30) do (<nul (SET/p z=#) & >nul ping 127.0.0.1 -n 2 )

)

ECHO *********************************************************************

:Done

popd

endlocal

EXIT

del %0

:Error1

cls

ECHO ********************************************************************

ECHO.

ECHO %msg2%

ECHO.

ECHO Invalid Operating System Detected:

ECHO.

ECHO %prodname%

ECHO Which uses %OSbuild% DriverPacks

ECHO Not currently supported

ECHO.

ECHO Please exit the program now!

ECHO.

ECHO ********************************************************************

pause

exit

:Error2

cls

ECHO ********************************************************************

ECHO.

ECHO.

ECHO %msg2%

ECHO.

ECHO.

ECHO un7zip.exe is missing.

ECHO.

ECHO.

ECHO Please exit the program now!

ECHO.

ECHO.

ECHO ********************************************************************

pause

exit

:Error3

cls

ECHO ********************************************************************

ECHO.

ECHO %msg2%

ECHO.

ECHO Invalid Operating System Detected:

ECHO.

ECHO %prodname% %ARCH%-bit OS

ECHO Installed on %PROCESSOR_ARCHITECTURE% processor

ECHO Not currently supported

ECHO.

ECHO Please exit the program now!

ECHO.

ECHO ********************************************************************

pause

exit

:usage

echo %0 is an batch program to automate the

echo installation of drivers on any Windows system.

echo Usage is %0 {/?!/h!/H} (only one switch used at a time)

echo /? or /h or /H will bring up this guide.

echo /S will enable "Silent" mode which will not prompt for options but will

echo execute the batch with whatever options are set as default.

pause

exit

:Elevate

::Credit to JohnGray http://www.sevenforu...and-prompt.html

:: try to write a zero-byte file to a system directory

:: IF successful, we are in Elevated mode and delete the file

:: IF unsuccessful, avoid the "Access is denied" message

SETlocal

:: arbitrary choice of system directory and filename

SET tst="%windir%\$del_me$"

:: the first brackets are required to avoid getting the message,

:: even though 2 is redirected to nul. no, I don't know why.

(type nul>%tst%) 2>nul && (del %tst% & SET elev=t) || (SET elev=)

IF defined elev (GOTO PROCESSOR) else ("%cur%\bin\elevate.cmd" "%pd%\DP_Install_Tool.cmd")

endlocal

Edited by Mr_Smartepants
Link to comment
Share on other sites

Welcome MR_Smartepants :) Which would you recommend pnputil or DrvInst?

I was thinking that if W7TRunOnce found a driver folder it could install all the drivers, but since you said drvinst only install those that are needed then im tempted to use drivinst :)

Link to comment
Share on other sites

Well really it depends on what the user wants to do.

DISM is the only one for offline images.

pnputil and dpinst are both for online (running) images but have different functions.

pnputil can be used to both add and remove drivers from the online driverstore (whether they're needed or not).

dpinst is used only to add drivers for hardware currently connected to the PC. (not efficient for external devices like printers etc. that need to be powered on)

dpinst can't be used to remove drivers though.

Ideally all three would be implemented for each of their unique strengths. I see W7T as a toolbox, you wouldn't want to be missing a screwdriver and have to resort to using a hammer. ;)

The user could indicate what folder they want the drivers forced (pnputil) and also a much larger folder to use if the system needs it (dpinst).

Edited by Mr_Smartepants
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...