Jump to content

[solution] Progress bar while extracting driver packs


jaws75

Recommended Posts

Ok I really disliked the fact that during driver decompression using the drivers from CD or driverpacks.net method the screen would stay blank for up to 5 minutes.

It looks like the installation is frozen.

The solution is here.

If you use a self extracting 7zip file with the right switches it will display a progress bar during extraction.

code for the self extracting archive is DPdriverpack-name.exe x -y -aoa -o"%SystemDrive%"

put the command

FOR %%h IN (%CDDRIVE%\OEM\Drivers\DP*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"

in your presetup.cmd file and the driverpacks will extract showing a progress bar.

no more blank screen. Make sure the path reflects the path to your files.

Note: Your driverpack files must begin with "DP" for it to work. Or change the batch file.

To take it one step further I wrote a batch file to convert your driverpacks (.7z files) to sfx files (.exe).

It modifies the dialog for each file so it will say "Extracting 3 of 10 > DP_driverpack_name..."

Example

extracting-tmb.jpg

How it works is...

1) makes a list of all the .7z archives in the current folder

2) counts them

3) creates a resource script (.rc) based on file number and name

4) compiles the resource script (.rc) into a resource file (.res)

5) uses reshacker to update the .sfx file with the new dialog (.res file)

6) converts the .7z file to a .exe self extracting file (via copy. NO recompression)

7) repeats 3-6 until all files are converted

The original .7z files are not deleted and the creation of the .exe files is very quick.

Note: NO recompression is done to the driverpacks. All it does is add the sfx module via the copy command. It runs as fast as your PC can copy a file. About 10 seconds or so for the 10 archives I used (223mb).

After conversion just put the .exe files in your OEM\drivers folder and add the above line to your presetup.cmd file and that's it.

Download the DP_files.zip file and extract it. put the files in the folder with your .7z driver files.

you will have the modify.bat file and the bin folder in there.

Run the modify.bat file.

You no longer need the .7z files, just the .exe files.

Download files

modify.bat

@echo off

set x=1
set z=0

dir /b /a-d DP*.7z > temp.txt
for /F "tokens=* delims= " %%h in (temp.txt) do call :count
for /F "tokens=* delims= " %%J in (temp.txt) do call :sub %%J

del /q temp.txt
del /q bin\ResHacker.ini
del /q bin\ResHacker.log

goto :eof
:sub

>diag.rc echo 500 DIALOG 0, 0, 195, 30
>>diag.rc echo STYLE DS_FIXEDSYS ^| DS_MODALFRAME ^| DS_CENTER ^| WS_POPUP
>>diag.rc echo CAPTION "Extracting"
>>diag.rc echo LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
>>diag.rc echo FONT 8, "MS Shell Dlg"
>>diag.rc echo {
>>diag.rc echo CONTROL "Extracting %x% of %z% > %~n1", 69, STATIC, SS_LEFT ^| WS_CHILD ^| WS_VISIBLE, 5, 2, 185, 8
>>diag.rc echo CONTROL "Progress1", 1000, "msctls_progress32", PBS_SMOOTH ^| WS_CHILD ^| WS_VISIBLE ^| WS_BORDER, 5, 12, 185, 13
>>diag.rc echo }

bin\gorc.exe /r diag.rc

bin\ResHacker.exe -addoverwrite bin\custom.sfx, bin\custom.sfx, diag.res,,,

copy /b bin\custom.sfx + %~nx1 %~n1.exe

del /q diag.rc
del /q diag.res

set /A x=%x%+1

goto :eof

:count
set /A z=%z%+1
goto :eof

Tested works with Pyron's, ile5's and BTS's setup.ex_

I use the program gorc.exe to compile the .rc files to .res files from below

Source

The background in my pic is achieved with this method

here

Any feedback would be great.

Thanks.

:EDIT: I removed the underscore "_" from the batch file to match the way BTS renames the files.

Edited by jaws75
Link to comment
Share on other sites


Thanks for the feedback.

If anyone has any ideas on how to improve this or advice on cleaning up the code please offer it.

Thanks.

I modified the above extraction code to...

FOR %%h IN (%CDDRIVE%\OEM\Drivers\DP_*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"

from

FOR %%h IN (%CDDRIVE%\OEM\Drivers\DP_*.exe) DO "%%h" e -y -o"%SystemDrive%"

While the original did not seem to present a problem I figured this makes it more robust.

It tested fine the new way.

ciao

Edited by jaws75
Link to comment
Share on other sites

For some reason I write my batch file with...

STYLE DS_FIXEDSYS | DS_MODALFRAME | DS_CENTER | WS_POPUP

But the final result always ends up like this

STYLE DS_FIXEDSYS | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION

The script is written correctly but gorc.exe when compiling is adding it.

The difference is the addition of the title bar.

It works without it and that's the way I like it but........

Is it improper not to have the title bar?

Should it always be there?

Is it bad code without it?

Should I add it back in to the code since it get's put there anyway?

Or should I not under protest?

Based on the lack of feedback maybe I should just let this project fade into obscurity.

Edited by jaws75
Link to comment
Share on other sites

  • 2 weeks later...
Note: Your driverpack files must begin with "DP_" for it to work.

Any way around this? My driver packs were renamed along the way (for example, DPGC609.7Z) and since its a multiboot with quite a few O/S's on it sharing the one OEM file, it would take some work to rename them. I am not quite sure when they got renamed along the way but if they can be changed back I would need to know what documents reference to them to change the wording back I guess. I looked in presetup.cmd, but it doesnt appear to be referencing them by their names specifically? Is it really just as simple as renaming them back?

Wish I would have read about this method before I started! Progress bars would rock!

Thanks in advance!

----Jeff

Edited by gospeed
Link to comment
Share on other sites

Note: Your driverpack files must begin with "DP_" for it to work.

Any way around this? My driver packs were renamed along the way

Simple fix.

In the batch file change the line

dir /b /a-d DP_*.7z > temp.txt

to

dir /b /a-d *.7z > temp.txt

and in your presetup.cmd change

FOR %%h IN (%CDDRIVE%\OEM\Drivers\DP_*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"

to

FOR %%h IN (%CDDRIVE%\OEM\Drivers\*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"

I don't like using *.exe just because any .exe in that folder will be executed.

If they all start with DP like your example without the underscore "_" then just delete that from the two locations. IE... change DP_ to just DP

On another note if you find the progress bar too large you can make it smaller by changing

>>diag.rc echo FONT 10, "MS Shell Dlg"

to

>>diag.rc echo FONT 8, "MS Shell Dlg"

I hope that helps.

Edited by jaws75
Link to comment
Share on other sites

Well, I guess I should ask, what method if driverpack install is this meant for? I used BTS driverpacks, and used driverpacks base to install them into each of my individual O/S's. I am using the method #2 where they create a fake setup that is executed before actual setup. My DVD works fine as it sits, but I notice that your folder structure is different than mine (your driver pack sits in OEM\Drivers, where mine is directly in OEM) and I am not sure if that makes a difference. I did modify the command to delete the _ and also edited my presetup.cmd to delete the _ and change the folder structure (deleted \Drivers). It skips right over where the drivers once were being installed, like it cant find the files. Is there any problem with the folder structure being different?

This is the contents of my OEM folder:

BIN

ATICCP.INS

DPC6091.7Z

DPCP6091.7Z

DPGA6011.7Z

etc...

There is no driver folder inside.

Edited by gospeed
Link to comment
Share on other sites

I use the driverpacks from BTS as well as the fake setup.exe from driverpack base but I do not use the driverpack base installer. I just do it manually instead.

Do you have...

FOR %%h IN (%CDDRIVE%\OEM\DP*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"

in you presetup.cmd file (notice the changes to reflect your info)

Is the OEM folder in the root of the CD? eg. D:\OEM

after running my batch file are all the .exe files created?

they should be put in your OEM folder instead of the .7z files.

Did you put them in the OEM folder?

If still not working show me the contents of your presetup.cmd to better help you.

Link to comment
Share on other sites

Yes to all :D

My Presetup wording is exactly that...it was only modified to add your line to it

my OEM folder is in the root...there is only one OEM folder but 6 O/S's that point to it

I performed the batch file within my OEM folder, and it seems to have created and edited just as designed- and then I deleted the .7z driverpacks.

Here is my presetup.cmd

Thanks for taking a look!

REM +==========================================================================+
REM | |
REM | This presetup.cmd file was dynamically generated by the DriverPacks |
REM | BASE, to work with the DriverPacks without any further editing. |
REM | However, if you would like to add some custom functionality, you can |
REM | edit this file without any problems. Just take into record that this |
REM | file will be erased if you run the DriverPacks BASE on these Windows |
REM | installation files again! |
REM | |
REM | With special thanks to: |
REM | -Pyron, a06lp and iLE for their help with this method; |
REM | -schalti for the optional 'Keep the Drivers' system and Pyron (again) |
REM | for turning it into an executable. |
REM | |
REM +==========================================================================+

REM +==========================================================================+
REM | Showing the progress bar |
REM |--------------------------------------------------------------------------|
FOR %%h IN (%CDDRIVE%\OEM\DP*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"


REM +==========================================================================+
REM | Finding CD/DVD driveletter. |
REM |--------------------------------------------------------------------------|
SET TAGFILE=\OEM
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:%TAGFILE%" SET CDDRIVE=%%i:


REM +==========================================================================+
REM | Decompressing the DriverPacks to the harddisk. |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\7z.exe x -y -aoa %CDDRIVE%\OEM\DP*.7z -o"%SystemDrive%"


REM +==========================================================================+
REM | Copying/decompressing the files to finish the installation. |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\7z.exe x -y -aoa %CDDRIVE%\OEM\bin\DPsFnshr.7z -o"%SystemDrive%"
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\


REM +==========================================================================+
REM | Scanning for driverdirectories. |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\DevPath.exe %SystemDrive%\D


REM +==========================================================================+
REM | Disable Driver Signing Policy and keep it disabled. |
REM |--------------------------------------------------------------------------|
START %SystemDrive%\DSPdsblr.exe


EXIT

Link to comment
Share on other sites

@jaws75, have you posted this on DP's forum ?

Yes I have.

gospeed

The problem is in your presetup.cmd file

The "showing the progress bar" section must go AFTER the "finding the CD/DVD drive letter" section. It has not determined the %CDDRIVE% variable yet for it to work before.

Also the original "Decompressing the DriverPacks to the harddisk." section can be commented out as it's not needed any more (add REM before the line) or you can remove the section.

The whole thing should look like this.

REM +==========================================================================+
REM | |
REM | This presetup.cmd file was dynamically generated by the DriverPacks |
REM | BASE, to work with the DriverPacks without any further editing. |
REM | However, if you would like to add some custom functionality, you can |
REM | edit this file without any problems. Just take into record that this |
REM | file will be erased if you run the DriverPacks BASE on these Windows |
REM | installation files again! |
REM | |
REM | With special thanks to: |
REM | -Pyron, a06lp and iLE for their help with this method; |
REM | -schalti for the optional 'Keep the Drivers' system and Pyron (again) |
REM | for turning it into an executable. |
REM | |
REM +==========================================================================+


REM +==========================================================================+
REM | Finding CD/DVD driveletter. |
REM |--------------------------------------------------------------------------|
SET TAGFILE=\OEM
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:%TAGFILE%" SET CDDRIVE=%%i:

REM +==========================================================================+
REM | Showing the progress bar |
REM |--------------------------------------------------------------------------|
FOR %%h IN (%CDDRIVE%\OEM\DP*.exe) DO "%%h" x -y -aoa -o"%SystemDrive%"

REM +==========================================================================+
REM | Decompressing the DriverPacks to the harddisk. |
REM |--------------------------------------------------------------------------|
REM %CDDRIVE%\OEM\bin\7z.exe x -y -aoa %CDDRIVE%\OEM\DP*.7z -o"%SystemDrive%"


REM +==========================================================================+
REM | Copying/decompressing the files to finish the installation. |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\7z.exe x -y -aoa %CDDRIVE%\OEM\bin\DPsFnshr.7z -o"%SystemDrive%"
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\


REM +==========================================================================+
REM | Scanning for driverdirectories. |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\DevPath.exe %SystemDrive%\D


REM +==========================================================================+
REM | Disable Driver Signing Policy and keep it disabled. |
REM |--------------------------------------------------------------------------|
START %SystemDrive%\DSPdsblr.exe


EXIT

Let me know how it worked.

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