Jump to content

Drivers from CD: Simple Method


a06lp

Recommended Posts

drivers.cmd

@echo off
FOR /F "tokens=2 delims= " %%A IN ('pausep.exe ^| findstr /I /L "setup.exe"') DO SET Setup_PID=%%A
pausep.exe %Setup_PID%
start watchdriversigningpolicy.exe
setupcopyoeminf.exe drivers
pskill.exe -t watchdriversigningpolicy.exe
pausep.exe %Setup_PID% /r
exit

I recommend using PsKill in stead of TaskKill. Taskkill won't work without Windows Management Instrumentation. Some people remove that component with nLite.

Edited by hp38guser
Link to comment
Share on other sites


drivers.cmd
@echo off
FOR /F "tokens=2 delims= " %%A IN ('pausep.exe ^| findstr /I /L "setup.exe"') DO SET Setup_PID=%%A
pausep.exe %Setup_PID%
start watchdriversigningpolicy.exe
setupcopyoeminf.exe drivers
pskill.exe -t watchdriversigningpolicy.exe
pausep.exe %Setup_PID% /r
exit

I recommend using PsKill in stead of TaskKill. Taskkill won't work without Windows Management Instrumentation. Some people remove that component with nLite.

that cmd code is high-end @@

salute hp38guser :thumbup

Link to comment
Share on other sites

FOR /F "tokens=2 delims=	 " %%A IN ('pausep.exe ^| findstr /I /L "setup.exe"') DO SET Setup_PID=%%A
pausep.exe %Setup_PID%

this doesn';t work - i've opened up a (different) setup.exe, and this doesnt find the pid.

but when i manually run pausep, i see setup.exe on the list....

can we fix this code?

Edited by a06lp
Link to comment
Share on other sites

pausep>%SystemDrive%\pid.txt
FOR /F "tokens=2" %%I IN ('findstr /I /L "setup.exe" %SystemDrive%\pid.txt) DO DEL %SystemDrive%\pid.txt & SET Setup_PID=%%I

redirect to a temp file and parse from it.

imho pausep=psSuspend :(

edit:

redo another install, same as psSuspend.

SetupCopyOEMInf slows down and stopped at some driver, after Ctrl-C SetupCopyOEMInf, and rescan again, it passed. same as i use psSuspend.

edit2:

@a06lp:

my lastest test, using NirCmd to detach another ticker script that resume-wait10sec-suspend-wait50sec-resume setup.exe, it works on my laptop with 63 driver paths. the modem driver which cause SetupCopyOEMInf stopped when setup.exe totally suspended, and it passed on resume-suspend-resume method.

combine this method and setPriority, SetupCopyOEMInf gets more cpu without interlocked.

to lower setup.exe's priority for batch guys, googled a freeware called Process.exe, it can Suspend/Resume/Kill/SetPriority/List processes in size 53,248 bytes/26,112 bytes(upx -9). use this program instead of psSuspend/psKill/psList myself.

NirCmd Freeware command-line tool, 47,104 bytes/25,088 bytes(upx -9). lots free utils at this site. use NirCmd to setting mixer/inetdial/shortcuts/etc myself. tried NirCmd's new command "cmdwait", it's not working @T-39.

@ECHO OFF

CD /D "%~dp0"

::REM Ticker script

ECHO.exec hide %CD%\Process.exe -r setup.exe >%SystemDrive%\Ticker.ncl

ECHO.wait 10000 >>%SystemDrive%\Ticker.ncl

ECHO.exec hide %CD%\Process.exe -p SetupCopyOEMInf.exe high >>%SystemDrive%\Ticker.ncl

ECHO.exec hide %CD%\Process.exe -s setup.exe >>%SystemDrive%\Ticker.ncl

ECHO.wait 50000 >>%SystemDrive%\Ticker.ncl

ECHO.script %SystemDrive%\Ticker.ncl >>%SystemDrive%\Ticker.ncl

::REM Suspend/Low setup.exe

.\Process.exe -s setup.exe

.\Process.exe -p setup.exe low

::REM OemPreinstall=No

IF EXIST $1.7z .\7za.exe x -y -aoa -o"%SystemDrive%\" ".\$1.7z"

IF EXIST $$.7z .\7za.exe x -y -aoa -o"%SystemRoot%" ".\$$.7z"

::REM DriversOnCD

START .\WatchDriverSigningPolicy.exe

SET DRV=DRV

::REM Drivers7z2HD

IF EXIST DRV.7z (

SET DRV=%SystemDrive%\DRV

.\7za.exe x -y -aoa -o"%SystemDrive%\DRV" ".\DRV.7z"

)

::REM NirCmd ticker

START .\NirCmd.exe script %SystemDrive%\Ticker.ncl

.\SetupCopyOEMInf.exe "%DRV%"

::REM PostInstall

.\Process.exe -k NirCmd.exe

.\Process.exe -p setup.exe normal

.\Process.exe -r setup.exe

DEL %SystemDrive%\Ticker.ncl

EXIT

green=optional, red=customize

add NirCmd.exe exec hide before script name in WINNT.SIF, hides pop-up cmd window.

Edited by idle.newbie
Link to comment
Share on other sites

redo another install, same as psSuspend.

SetupCopyOEMInf slows down and stopped at some driver, after Ctrl-C SetupCopyOEMInf, and rescan again, it passed. same as i use psSuspend.

I'm out of ideas.

How do we get around this problem?

Link to comment
Share on other sites

Hey guys approx how many pnp drivers are you installing? & is that the issue maybe? I do under twelve & no slow downs or issues here.

put more drivers and try...

realtek.com.tw got a lot inf

ati.com got a lot inf inside their drivers

Link to comment
Share on other sites

Hey guys approx how many pnp drivers are you installing? & is that the issue maybe? I do under twelve & no slow downs or issues here.

i mentioned earlier it only effects you if there's like 30+ (maybe more)

my lastest test, using NirCmd to detach another ticker script that resume-wait10sec-suspend-wait50sec-resume setup.exe, it works on my laptop with 63 driver paths. the modem driver which cause SetupCopyOEMInf stopped when setup.exe totally suspended, and it passed on resume-suspend-resume method.

combine this method and setPriority, SetupCopyOEMInf gets more cpu without interlocked.

I'm not understanding your method.

But I know AutoIt has a built in process priority function, which we make use of in the first-post-method.

What are you saying here? resume, suspend, resume? [i dont understand]

Also maybe the 50 seconds is too small to cause the freeze-up. Have you tried with longer times?

Edited by a06lp
Link to comment
Share on other sites

they're the same for setPriority, only it's in batch.

i added another ticker script which loops until SetupCopyOEMInf ends. 10sec to run setup.exe, 50sec to suspend it, loops.

SetupCopyOEMInf freeze when setup.exe suspended, i guess that's because they need to update something with setupapi.dll. the ticker script gives setup.exe 10sec within 1min to update, so they won't interlocked and setup.exe uses lesser cpu(1/6).

10 : 50 that's for my laptop. besides, setup.exe=low, SetupCopyOEMInf.exe=high. i had bad experience with resume time less than 10sec.

Edited by idle.newbie
Link to comment
Share on other sites

WatchDriverSigningPolicy Info

I forgot who asked me a while ago, but the source for WatchDriverSigningPolicy is here.

Although the attachment doesn't seem to be working, the basic outline of the code is in the post.

Also, it should be noted that WatchDriverSigningPolicy works most of the time, but occassionally the dialog for the installation of unsigned drivers pops up nevertheless. Pyron said he has no idea why, but Setup seems to ignore the registry values sometimes. :(

Edited by a06lp
Link to comment
Share on other sites

@idle.newbie:

Looks good (in theory), I'm going to test this later.

(Also, the code looks NICE ;))

[Edit]

@idle.newbie:

You said that SetupCopyOEMInf freezes when setup.exe suspended, because something with setupapi.dll has to be updated.

It appears you are right. A while ago, someone asked about the source for SetupCopyOEMInf, and the response was:

If you want to create your own utility it's a matter of scanning a directory structure for INF-Files and use the API call SetupCopyOEMInf (which is inside setupapi.dll) on every INF-File.

So at least we know why setup cannot be paused totally...

Edited by a06lp
Link to comment
Share on other sites

i'm creating my ISO image now - then comes burn, and test time.

*crosses fingers*

[edit]

It Worked!

Updating first post now.

I'm going to re-post the AutoIt method (for backup sake, and for those who want to continue using it) in my next post.

EVERYONE PLEASE TEST THE UPDATED METHOD IN THE FIRST POST. I NEED TO KNOW THAT IT IS WORKING FOR ALL OF YOU.

Edited by a06lp
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...