Topic: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

If you currently launch DP_Install_Tool.cmd via a menu (i.e. you're not in /OEM) then DPINST.* isn't copied to %systemdrive%! Please amend the script to use defined paths.

:M2Found
Echo.
Echo Extracting the DriverPacks now...
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\DP*.7z %SystemDrive%\
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\bin\*.7z %SystemDrive%\
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\

:: Current entries
:: COPY DPINST.exe %SystemDrive%
:: COPY DPInst.xml %SystemDrive%

:: My edit
COPY /Y %CDDRIVE%\OEM\DPINST.* %SystemDrive%\

GoTo Main

Thanks.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

Thank you so much...
that is an excellent observation and a situation i had not considered.

i will make the suggested changes to make it resilient against this.

thanks for not only finding the problem but providing a possable solution as well.
I am going to tag your post as a [REQ] for you.
if you like you can create a "bug" report so i wont forget, and it is a rare opportunity wink
the bug tracker here plays cards with the maytag repairman... wink

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

No problem smile


Off topic...

I noticed something else that to me just seams a little miss leading:

:Main
Echo.
Echo Running MicroSoft DPinst.exe now!

I'm not an advocate for Microsoft or anything but wouldn't something like this be more accurate:

:Main
Echo.
Echo Running the DriverPacks.net Installer now!

Just a thought.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

NO because DPInst.exe is a microsoft file that they have graciously allowed redistribution rights on.

microsoft does not very often say that it is ok to redistribute their files so i want to make sure they get the credit.

They wrote it they provided it and i humbly submit it with our app and my thanks for the privilege.

jeff

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

Another question:
has OEM and $OEM$ to be at root directory?

There is Flyakite's Multiboot Guide.
http://flyakite.msfn.org/
http://flyakite.msfn.org/unattended.htm

What about support both: root directory and subdirectory?

Color 9f

setlocal EnableExtensions

Echo.
Echo Searching local directory for the DriverPacks...
pushd "%~dp0.."
set CDDRIVE=%cd%
popd
SET last_char=%CDDRIVE:~-1%
IF "%last_char%"=="\" set CDDRIVE=%CDDRIVE:~0,-1%
IF exist %CDDRIVE%\$OEM$\$1\D echo goto M1Found
IF exist %CDDRIVE%\OEM\bin\un7zip.exe echo GoTo M2Found

Echo.
Echo Searching all drives now...

Debug code, remove two echo for usage.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

if a m1 install is in the same folder you could just launch dpinst.

(this works as long as the packs areextracted or cabbed to \D. where D\ is a subfolder of the location of dpinst.)
that is even easier and it wont try to delete the files either wink

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

NO because DPInst.exe is a microsoft file that they have graciously allowed redistribution rights on.

microsoft does not very often say that it is ok to redistribute their files so i want to make sure they get the credit.

They wrote it they provided it and i humbly submit it with our app and my thanks for the privilege.

jeff

WOW yikes. I stand corrected then.

I've been waiting for this for a long time so I thought you were selling this little app short by giving Microsoft all the credit.

It's nice to see MS playing ball smile

Last edited by kof94 (2008-05-26 01:25:42)

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

Ok, one last thing.

This is my final edit. I've added a title with a "Do you wish to continue?" question (because this suits my situation) and an "Operation Complete" message at the end (because I think it needed it) as well as some other cosmetic changes.

Here you go:

@Echo off
REM Written by Jeff Herre AKA OverFlow rev08.04.21
REM A Script to use MicroSofts DPinst.exe with the DriverPacks.
REM Help and Support available at http://forum.DriverPacks.net  
Color 9f

Echo.
Echo You are about to install or update Windows XP device drivers.
Echo.
SET /p YN=Do you wish to continue? (Y/N) 
IF /I %YN%==N GoTo Done
cls

Echo.
Echo Searching current drive for the DriverPacks...
Rem fast detect. (is it the current drive?)
FOR /f "delims=: tokens=1" %%i in ("%~dp0") do SET CDDRIVE=%%i:
IF exist %CDDRIVE%\$OEM$\$1\D goto M1Found
IF exist %CDDRIVE%\OEM\bin\un7zip.exe GoTo M2Found

Echo.
Echo Searching all drives now...
Rem alternate detection. (is it any available drive?)
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$\$1\D" SET CDDRIVE=%%i:& GoTo M1Found 
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 CDDRIVE=%%i:& GoTo M2Found

Echo.
Echo The DriverPacks were not found ???
Echo.
Pause
GoTo Done

:M2Found
Echo.
Echo Extracting the DriverPacks now...
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\DP*.7z %SystemDrive%\
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\bin\*.7z %SystemDrive%\
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\ > nul
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\ > nul
COPY /Y %CDDRIVE%\OEM\DPINST.* %SystemDrive%\ > nul
GoTo Main

:M1Found
Echo.
Echo If you wish you may update drivers directly from the located M1 source
Echo Or you can use the DriverPacks and DP_Finisher with "Keep The Driver" option.
Echo If you choose Finisher and KTD then DriverPacks will be copied to "SystemDrive" 
Echo.
SET /p TPP=Only DriverPacks or Finisher and DriverPacks? (O or F) 
IF /I %TPP%==O "%CDDRIVE%\$OEM$\$1\DPINST.exe" /c /s & GoTo Done 
XCOPY /S %CDDRIVE%\$OEM$\$1\. %SystemDrive%

:Main
Echo.
Echo Running Microsoft DPinst.exe now...
%SystemDrive%\DPINST.exe /c /s > nul
Echo.
Echo Running the DriverPacks.net Finisher now...
%SystemDrive%\DPsFnshr.exe

Echo.
Echo Operation Complete!
Echo.
pause

:Done
EXIT

I'll stop messing with your script now smile.

Last edited by kof94 (2008-05-26 02:21:28)

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

i already had a "do you wish" button wink


I noticed you did away with the progress indicators
you are ok with the periods of no feedback you created?
I like to be aware of the progress - just my personal preference.

Anybody else think the script is too chatty?

-----------------

I deliberately did not make this an executeable so it could be edited wink
that was / is the idea tongue
(normaly i try to see how much code i can fit on one line wink but that is hard to read and edit...)

I dont see me adding the additional pauses in the released copy...
i deliberately wrote it to be automated and I tout it as a "One Click" solution
(you added 200% more clicking wink )
this is in keeping with our forums unattended theme and our primary goals.

But as you have discovered i wrote it to be easy to read by anyone. intentionaly

feel free to get as wild as you want with your version!!! and to post it as a reference for others.

not all submissions will be included - but your first edit made the cut anyway

I am open to making the script less chatty if it proves to be a popular suggestion.

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

I just noticed something else that made no sense to me....

%SystemDrive%\DPINST.exe /c /s > nul

/c means please log to console and would then seem to be in direct conflict with > null

so you should have written

%SystemDrive%\DPINST.exe /s > nul
or simply
%SystemDrive%\DPINST.exe /s

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

I prefer it to be silent with a few indicators of progression, it just looks cleaner! That said I haven't added any error correction so if anything went wrong the script would just sit there forever. It might be a good idea to setup some kind of logging function (a simple redirect on the script doesn't pick up DPinst output).

I wanted the "Do you wish" prompt encase I clicked the wrong option in my autorun menu and I also wanted the "complete" message for 'set it and forget it' purposes (because I want to know it completed)!

I think this is as "wild" as it's going to get really and I admit I didn't check the switches for DPinst. smile

Last edited by kof94 (2008-05-28 09:37:15)

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

I am not positive without looking it up...
i think dpinst automatically creates a log

even if it doesnt i am quite certain  setupapi.log  IS updated
so there is a full log available if needed.
as far as a log of the script...
it logs to the active window so if it hangs, you know where... wink
(ummm unless you >null all the output! tongue )

perhaps it would be easy enough to add somthing like...

@Echo off
REM Written by Jeff Herre AKA OverFlow rev08.05.27
REM A Script to use MicroSofts DPinst.exe with the DriverPacks.
REM Help and Support available at http://forum.DriverPacks.net  
TITLE DriverPacks Installation Tool
Color 9f
Set LOG=%SystemDrive%\DP_Install_Tool.log

Echo.
Echo Searching current drive for the DriverPacks...
Echo fast detect. (is it the current drive?) >> %LOG%
FOR /f "delims=: tokens=1" %%i in ("%~dp0") do SET CDDRIVE=%%i:
IF exist %CDDRIVE%\$OEM$\$1\D goto M1Found
IF exist %CDDRIVE%\OEM\bin\un7zip.exe GoTo M2Found

Echo.
Echo Searching all drives now...
Echo alternate detection. (is it any available drive?) >> %LOG% 
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$\$1\D" SET CDDRIVE=%%i:& GoTo M1Found 
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 CDDRIVE=%%i:& GoTo M2Found

Echo.
Echo The DriverPacks were not found ???
Echo The DriverPacks were not found ??? >> %LOG%
Pause
GoTo Done


:M2Found
Echo M2 Found >> %LOG%
Echo.
Echo Extracting the DriverPacks now...
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\DP*.7z %SystemDrive%\  %LOG%
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\bin\*.7z %SystemDrive%\ %LOG%
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\ >> %LOG%
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\ >> %LOG%
COPY /Y %CDDRIVE%\OEM\DPINST.* %SystemDrive%\ >> %LOG%
GoTo Main


:M1Found
Echo M1 Found >> %LOG%
Echo.
Echo If you wish you may update drivers directly from the located M1 source
Echo Or you can use the DriverPacks and DP_Finisher with "Keep The Driver" option.
Echo If you choose Finisher and KTD then DriverPacks will be copied to "SystemDrive" 
Echo.
SET /p TPP=Only DriverPacks or Finisher and DriverPacks? (O or F) 
IF /I %TPP%==O Echo Running MicroSoft DPinst.exe without the DriverPacks Finisher now! >> %LOG%
IF /I %TPP%==O "%CDDRIVE%\$OEM$\$1\DPINST.exe" /c /s & GoTo Done 
XCOPY /S %CDDRIVE%\$OEM$\$1\. %SystemDrive% >> %LOG%


:Main
Echo.
Echo Running MicroSoft DPinst.exe now!
Echo Running MicroSoft DPinst.exe now! >> %LOG%
%SystemDrive%\DPINST.exe /c /s
Echo.
Echo Running the DriverPacks.net Finisher now!
Echo Running the DriverPacks.net Finisher now! >> %LOG%
%SystemDrive%\DPsFnshr.exe



:Done
EXIT
DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

OverFlow wrote:

I am not positive without looking it up...
i think dpinst automatically creates a log

even if it doesnt i am quite certain  setupapi.log  IS updated
so there is a full log available if needed.
as far as a log of the script...
it logs to the active window so if it hangs, you know where... wink
(ummm unless you >null all the output! tongue )

perhaps it would be easy enough to add somthing like...

@Echo off
REM Written by Jeff Herre AKA OverFlow rev08.05.27
REM A Script to use MicroSofts DPinst.exe with the DriverPacks.
REM Help and Support available at http://forum.DriverPacks.net  
TITLE DriverPacks Installation Tool
Color 9f
Set LOG=%SystemDrive%\DP_Install_Tool.log

Echo.
Echo Searching current drive for the DriverPacks...
Echo fast detect. (is it the current drive?) >> %LOG%
FOR /f "delims=: tokens=1" %%i in ("%~dp0") do SET CDDRIVE=%%i:
IF exist %CDDRIVE%\$OEM$\$1\D goto M1Found
IF exist %CDDRIVE%\OEM\bin\un7zip.exe GoTo M2Found

Echo.
Echo Searching all drives now...
Echo alternate detection. (is it any available drive?) >> %LOG% 
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$\$1\D" SET CDDRIVE=%%i:& GoTo M1Found 
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 CDDRIVE=%%i:& GoTo M2Found

Echo.
Echo The DriverPacks were not found ???
Echo The DriverPacks were not found ??? >> %LOG%
Pause
GoTo Done


:M2Found
Echo M2 Found >> %LOG%
Echo.
Echo Extracting the DriverPacks now...
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\DP*.7z %SystemDrive%\  %LOG%
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\bin\*.7z %SystemDrive%\ %LOG%
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\ >> %LOG%
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\ >> %LOG%
COPY /Y %CDDRIVE%\OEM\DPINST.* %SystemDrive%\ >> %LOG%
GoTo Main


:M1Found
Echo M1 Found >> %LOG%
Echo.
Echo If you wish you may update drivers directly from the located M1 source
Echo Or you can use the DriverPacks and DP_Finisher with "Keep The Driver" option.
Echo If you choose Finisher and KTD then DriverPacks will be copied to "SystemDrive" 
Echo.
SET /p TPP=Only DriverPacks or Finisher and DriverPacks? (O or F) 
IF /I %TPP%==O Echo Running MicroSoft DPinst.exe without the DriverPacks Finisher now! >> %LOG%
IF /I %TPP%==O "%CDDRIVE%\$OEM$\$1\DPINST.exe" /c /s & GoTo Done 
XCOPY /S %CDDRIVE%\$OEM$\$1\. %SystemDrive% >> %LOG%


:Main
Echo.
Echo Running MicroSoft DPinst.exe now!
Echo Running MicroSoft DPinst.exe now! >> %LOG%
%SystemDrive%\DPINST.exe /c /s
Echo.
Echo Running the DriverPacks.net Finisher now!
Echo Running the DriverPacks.net Finisher now! >> %LOG%
%SystemDrive%\DPsFnshr.exe



:Done
EXIT

Overflow, there is a much more efficient method for creating log files. I used it in my Presetup.cmd file that I posted here. Here is an example:

@Echo Off
Set LogFile=%SystemRoot%\MYAWESOMELOGFILE.LOG

@Call :MainScriptRoutine>"%LogFile%"
@REM * More stuff here if you want...
Goto :EOF
Exit

:MainScriptRoutine
@REM * put all of your above stuff in here (sans references to %LOG%)

Goto :EOF

Notice that I suppress the STDOutput of the pseudo-function that is being Called and stick it into a log file?
I suppose if you want that information to also be echoed back to the user, you could use Type %LogFile%.

This method will not work if your routine requires user interaction. If user interaction is required, I would recommend breaking up the routines and appending the log file using the same method, but with user interactions between each of the Calls to the routine. Personally, I put all user interaction at the beginning of the script and call the variables as needed once the script begins running.


Not saying you have to use that method, but it's a lot easier to manage than the deprecated DOS method. smile

Re: [IMPLEMENTED] Edit DP_Install_Tool.cmd [Approved]

I deliberately used the simplest form of all commands and layout...

It was/is my intention to make it EASY to edit for anyone with even the most basic skills.

Obviously i could have written this much differently and made it hundreds of lines long.
if i had then only advanced programers could read and modify it.
as it is advanced programmers can take it where ever they like and weekenders can read and tweak it too.

again - This is not meant to be an exercise in demonstrating my programing ability it is meant to be an outline...
as such only sugestions that simplify it are appropriate wink

I do however encourage you guys to compare notes and your personal versions with each other.
I am sure with our userbase that you guys will post some awsome ideas. i probably will not implement them for the reasons i stated. much as i will not implement the logging example/idea above. it was just a simplest form example. I belive it is best to target the users with beginner skills, the advanced users are on their own wink

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.