Topic: Ability to add a custom command to PRESETUP.CMD

Been playing with a program written in VB 6 that can run while the drivers are extracted (method 2).

Would be good if the DriverPack Base had an option to run a command after detection of the CD drive letter and before beginning the extraction process. It would save me from editing the PRESETUP.CMD as below every time I make a change:

*SNIP*
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:

::Below added manually to show some sort of progress
start c:\install\trtprog.exe Please wait while drivers are extracted...

REM +==========================================================================+
REM |   Decompressing the DriverPacks to the harddisk.               
*SNIP*

BTW, this program runs well and displays a progress bar and my company logo for the duration of the extraction. If someone can tell me how to attach the program and/or it's VB source to a forum message (or somewhere else) I'm happy to.

I never know what to put in a signature.

Re: Ability to add a custom command to PRESETUP.CMD

Rambo, just saw your note and I would be very interested in getting hold of a copy of you progress bar.... any chance you could send me a copy?

Re: Ability to add a custom command to PRESETUP.CMD

Maybe you can help, see this post about "splash screen" during DP extract.

Re: Ability to add a custom command to PRESETUP.CMD

i'm not having much success with this, I have tried to create a splash screen using AutoIT and then adding it into presetup.cmd but it will not run / display.

It works find when executed under normal windows i.e XP hence my note to get a copy of trtprog.exe.

Will keep trying.... if I have any success will I will post a reply

Re: Ability to add a custom command to PRESETUP.CMD

I've seen the earlier posts regarding splash screens and how nobody seems to be able to get it working.

Most had tried AutoIt scripts (me too!) but I found that they simply exit with no message of any sort.

Seems that something about the environment at that point in the setup means that many programs simply don't work. Since AutoIt scripts don't work, I decided to try a VB 6 program - I'm not much of a coder, but wrote something quick to test. I was quite surprised when I could see my program run during the extraction.

Being VB6 this is a full GUI, but at at this time its a little 'dumb' in that it doesn't actually detect when the extraction process is complete. It only exits under three conditions.
1. Manually closed
2. When it detects that XCOPY.EXE is running
3. When Windows setup completes and restarts

If there is interest I'm happy to (and have just done so for firefox) send people source code. I plan to try to enhance it a bit, but don't have a huge amount of time (or great programming skills!). Just my small contribution to say a small thanks.

Rambo...

I never know what to put in a signature.

Re: Ability to add a custom command to PRESETUP.CMD

Rambo wrote:

=Would be good if the DriverPack Base had an option to run a command after detection of the CD drive letter and before beginning the extraction process. It would save me from editing the PRESETUP.CMD as below every time I make a change:

These kind of things I do with Fedit.exe, more info here:
http://www.msfn.org/board/index.php?sho … =fedit.exe

Could you email me a logo-less version ? Thanks in advance,

Re: Ability to add a custom command to PRESETUP.CMD

Why not replace completely PRESETUP.CMD with an AutoIT made PRESETUP.EXE which does the commands ?
On the splash screen we can show "decompression driverpack xxx"
I've compiled the fake setup to show the PRESETUP (option : "mySHELLEXECUTEINFO.nShow=SW_SHOW;") ... then any program ran from this fake setup is shown.

Or ... still use PRESETUP.CMD with :
a/ fake setup showing the PRESETUP.CMD
b/ but with Signet cmdow.exe remplacement
c/ inside PRESETUP.CMD use an AutoIT "splash.exe" like the one i've coded in the other post.
I've already done a/ and c/ ... I need to add b/ and test it.

AutoIT "splash.exe" source (message is shown depending file size, given as first parameter on the command line) :

If $CmdLine[0] = 1 Then
    Dim $Message, $WaitFor, $Size
    $Size = FileGetSize($CmdLine[1])
    $WaitFor = $Size / 4000
    $Message = "Decompressing DP: " & @CRLF & $CmdLine[1]
    SplashTextOn("",$Message,"700","150","-1","-1",33,"","20","20")
    Sleep($WaitFor)
    SplashOff()
Else
    MsgBox(4096, "Information", "How to use : " & @CRLF & @ScriptName & "  Message_to_show", 5)
EndIf

Last edited by maxximum (2006-11-17 19:42:30)

Re: Ability to add a custom command to PRESETUP.CMD

Thanks for the code Rambo, well I'm very happy with the solution, the code works great

Thanks for all you help

Re: Ability to add a custom command to PRESETUP.CMD

*

Why not replace completely PRESETUP.CMD with an AutoIT

*
i have to dis-agrea here though,  there are so many better ways.. 1 for instance is a compiled ' Visual basic '  program,  i would recommend an early version like VB5 though, im not sure what versions will run this early, and in windows 2000, as it MAY lack vb-runtime files.

an other, (maybe better) way is a compiled  batch of quickbasic  script.  it will run (without doubt), but it will not look as pretty, as vb5 ...  >> quckbasic or compiled-batch doesn't nead runtime files so that makes it better for the job, also i'd suspect it to be easier to code than auto-it scripts... 

a thing though is that i cant think of any way to query for a status ... (like the  ..% extracted in 7zip)
>> unless you use sfx files (self extracting archives) ...
with sfx-files you would be able to show a popup window with the <cancel> button disabled...
and with some resource-editing in the text  saying... 
"extracting: $file_name [1 of 6]  " /  " extracting: $file_name [2 of 6]  etc.

- but i wonder if its worth this much trouble....

Last edited by -I- (2006-11-18 00:23:22)

disclaimer:
Any posts written by me or on my behalf comes strictly with no implicit warenty unless clearly stated otherwise.
Following any advise i might give, is done soly at one's own risk.
Never give away person-identifiable information about yourself unless you absolutely know for sure you can trust the person you give it to...

Re: Ability to add a custom command to PRESETUP.CMD

i have to dis-agrea here though,  there are so many better ways.. 1 for instance is a compiled ' Visual basic '  program,  i would recommend an early version like VB5 though, im not sure what versions will run this early, and in windows 2000, as it MAY lack vb-runtime files.

I've tested an compiled AutoIT script, and it works. No other files are needed other than the program itself.

- but i wonder if its worth this much trouble....

Add 3rd party DriverPacks ... and you could wait more than 5 minutes during this blue screen asking yourself "WTF is going on....".
So ... yes ... knowing what is going on is better ...

Last edited by maxximum (2006-11-18 05:20:16)

Re: Ability to add a custom command to PRESETUP.CMD

maxximum wrote:

i have to dis-agrea here though,  there are so many better ways.. 1 for instance is a compiled ' Visual basic '  program,  i would recommend an early version like VB5 though, im not sure what versions will run this early, and in windows 2000, as it MAY lack vb-runtime files.

I've tested an compiled AutoIT script, and it works. No other files are needed other than the program itself.

- but i wonder if its worth this much trouble....

Add 3rd party DriverPacks ... and you could wait more than 5 minutes during this blue screen asking yourself "WTF is going on....".
So ... yes ... knowing what is going on is better ...

Then I'm very interested...

I've actually written a new presetup in AutoIt, but couldn't get it to work (with fancy progress info and the functionality to add custom commands). I managed to retrieve the exact error by executing the file manually from a cmd.exe instance, called by the currently used presetup. I can look it up if anyone'd like to know.

If I start it just one minute after GUI setup has started, then it works. If I start it earlier, I get an error. It's obvious that the AutoIt compiler/runtime/whatever the correct name is, relies on certain Windows API calls that aren't available yet at the presetup stage.

So please, share the knowledge.

P.S.: I AM aware of the fact that AutoIt 2.x executables do work at the presetup stage, but that syntax is completely different AND the options/AutoIt functions are much much much more limited.

Founder of DriverPacks.net — wimleers.com