| View previous topic :: View next topic |
| Author |
Message |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Dec 23, 2002 12:36 am Post subject: Progress Bar with Run Command |
|
|
Need help using a Progress Bar with Run Command.
all feedback welcomed, thanks, nt
| Code: |
:ExtractBUTTON
%d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
%x = 1
repeat
%%drive = @substr(%d, %x)
%v = @volinfo(%%drive,T)
if @equal(%v,CD-ROM)
info Insert Win98 in %%drive drive
IF @ASK(Is Win98 CD in %%drive %v drive?)
rem end
rem %x = @succ(%x)
rem until @greater(%x, 26)
GOTO NEXT
else
end
info File is still missing
exit
end
%x = @succ(%x)
until @greater(%x, 26)
exit
:NEXT
IF @FILE(C:\Windows\Command\extract.exe)
goto NEXT2
ELSE
info Extract Utility not in expected directory
exit
:NEXT2
DIALOG ADD,PROGRESS,FILECOPY,30,7,270,15,0
REPEAT
%I = @succ(%I)
runh Extract /Y /A %%drive:\win98\Precopy1.cab Hwinfo.exe /l c:\AAA
wait .3
UNTIL @EQUAL(%I,40)
ELSE
end
exit
|
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Dec 23, 2002 1:07 am Post subject: |
|
|
I'd use the Extract.exe utility to extract a list of filenames to a text file first.
Then load the textfile into a VDS string list. Get a count of the number of
filenames in the string list to set your progress by.
If you need an example, just ask. It might take a few though!  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Dec 23, 2002 1:20 am Post subject: |
|
|
Here's what I've come up with, nt.
I haven't tried this to see if it works. If not, I'll gladly work out the bugs.
Just let me know.
| Code: |
:ExtractBUTTON
%d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
%x = 1
repeat
%%drive = @substr(%d, %x)
%v = @volinfo(%%drive,T)
if @equal(%v,CD-ROM)
info Insert Win98 in %%drive drive
IF @ASK(Is Win98 CD in %%drive %v drive?)
rem end
rem %x = @succ(%x)
rem until @greater(%x, 26)
GOTO NEXT
else
end
info File is still missing
exit
end
%x = @succ(%x)
until @greater(%x, 26)
exit
:NEXT
IF @FILE(C:\Windows\Command\extract.exe)
goto NEXT2
ELSE
info Extract Utility not in expected directory
exit
:NEXT2
runh Extract.exe /Y /D %%drive:\win98\Precopy1.cab *.*>@path(%0)files.txt
list create,1
list loadfile,1,@path(%0)files.txt
%c = @count(1)
list close,1
rem You can delete the files.txt file if you want
DIALOG ADD,PROGRESS,FILECOPY,30,7,270,15,0
REPEAT
%I = @succ(%I)
runh Extract /Y /A %%drive:\win98\Precopy1.cab Hwinfo.exe /l c:\AAA
dialog set,FileCopy,@div(@prod(%I,100),%c)
wait .3
UNTIL @EQUAL(%I,40)
ELSE
end
exit
|
Enjoy! _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Dec 23, 2002 1:51 am Post subject: |
|
|
Hey nt,
Arre you trying to copy a single file, or all files from an archive?
Cause your sample tries to install the same proggy 40 times.
If you want to install all files, don't close the string list that you used to
get the number of files from. Loop through it instead substituting the
HwInfo.exe with the item from the string list.
Disregard the code I posted above. It don't work!!!!!!
But this does: (Assuming you want to copy all files from the cabinet.)
| Code: |
:ExtractBUTTON
%d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
%x = 1
repeat
%%drive = @substr(%d, %x)
%v = @volinfo(%%drive,T)
if @equal(%v,CD-ROM)
info Insert Win98 in %%drive drive
IF @ASK(Is Win98 CD in %%drive %v drive?)
rem end
rem %x = @succ(%x)
rem until @greater(%x, 26)
GOTO NEXT
else
end
info File is still missing
exit
end
%x = @succ(%x)
until @greater(%x, 26)
exit
:NEXT
IF @FILE(C:\Windows\Command\extract.exe)
goto NEXT2
ELSE
info Extract Utility not in expected directory
exit
:NEXT2
runh command.com /c Extract.exe /D E:\win98\Precopy1.cab *.*>@path(%0)files.txt
wait 1
list create,1
list loadfile,1,@path(%0)files.txt
%c = @count(1)
DIALOG ADD,PROGRESS,FILECOPY,30,7,270,15,0
REPEAT
%I = @succ(%I)
list seek,1,%I
runh Extract /Y /A E:\win98\Precopy1.cab @item(1) /l c:\AAA
dialog set,FileCopy,@div(@prod(%I,100),%c)
wait .3
UNTIL @EQUAL(%I,%c)
list close,1
file delete,@path(%0)files.txt
ELSE
end
exit
|
Hope this is what ya needed  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Dec 23, 2002 4:16 am Post subject: Thanks bweckel for the assistance |
|
|
Thanks bweckel for the assistance.
Getting error message 19 at line 64. (List Index out of range)
Modified Line 55 from static drive letter to %%drive.
Modified Line 55 from *.* to hwinfo.exe
Modified Line 65 from static drive letter to %%drive.
Added additional script below that was lefft out from first post.
Rough draft...will beautify if and after bugs have been worked out.
The script below will be used with misc setup programs. Script/Prog below would be loaded first via SETUP Prog. If SETUP Prog discovers missing system files on client machine...Setup Prog would RUN Script/Prog below to install missing MS Files. The hwinfo.exe is just being used for below script. The {misc setup programs} would require there own specific MS System files as needs dictate. May be one file or many files. I figured if I could get Hwinfo.exe to work...modifcations would be simple and as needed per program needs.
Hoping to get this to work so I can get needed MS Files from end-users original Windows CD/Disketts...keeps us from running afoul with the ms distributing copyrights.
Thanks for all assistance, nt
| Quote: |
option ErrorTrap,ErrorBranch
option Decimalsep,.
option Fieldsep,|
option Scale,96
title Extract Utility
%%programname = Extract Util
DIALOG CREATE,Ext Util,-1,0,426,60,,CLASS Ext Utility,,%%StyleColorDlg
DIALOG ADD,BUTTON,EXIT1,20,350,60,24,Exit,,,HAND
DIALOG ADD,BUTTON,Extract,20,180,60,24,Extract,,,HAND
DIALOG ADD,BUTTON,Delete,20,250,90,24,Delete Folder,,,HAND
DIALOG ADD,BUTTON,Open,20,20,90,24,Open Folder,,,HAND
DIALOG SHOW
:Main_evloop
wait event
%E = @event()
goto %E
:Close
exit
:Exit1BUTTON
exit
:ErrorBranch3
%%null = @msgbox("An error has occured with the "@chr(34)%%ProgramName@chr(34)@cr()"program. You may wish to write down the following"@cr()"information and report this to author of the program:"@cr()@cr()"Error Code:"@tab()@error(E)@cr()"Line Number:"@tab()@error(N)@cr()"Event Status:"@tab()%E@cr()@cr()"Please report the error information to:"@cr()@tab()"support@noveltech.com",Program Error,$010)
stop
:ExtractBUTTON
%d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
%x = 1
repeat
%%drive = @substr(%d, %x)
%v = @volinfo(%%drive,T)
if @equal(%v,CD-ROM)
info Insert Win98 in %%drive drive
IF @ASK(Is Win98 CD in %%drive %v drive?)
GOTO NEXT
else
end
info File is still missing
goto Main_evloop
end
%x = @succ(%x)
until @greater(%x, 26)
goto Main_evloop
:NEXT
IF @FILE(C:\Windows\Command\extract.exe)
goto NEXT2
ELSE
info Extract Utility not in expected directory
goto Main_evloop
:NEXT2
runh command.com /c Extract.exe /D N:\win98\Precopy1.cab hwinfo.exe>@path(%0)files.txt
wait 1
list create,1
list loadfile,1,@path(%0)files.txt
%c = @count(1)
DIALOG ADD,PROGRESS,FILECOPY,30,7,270,15,0
REPEAT
%I = @succ(%I)
list seek,1,%I
runh Extract /Y /A E:\win98\Precopy1.cab @item(1) /l c:\AAA
dialog set,FileCopy,@div(@prod(%I,100),%c)
wait .3
UNTIL @EQUAL(%I,%c)
list close,1
file delete,@path(%0)files.txt
ELSE
end
goto Main_evloop
:OpenBUTTON
SHELL open,C:\AAA
goto Main_evloop
:DeleteBUTTON
IF @ASK(DELETE the folder C:\AAA?)
directory delete, C:\AAA
goto Main_evloop
end
info Ok - we will go back and wait
goto Main_evloop
|
Last edited by noveltech on Mon Dec 23, 2002 6:02 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Dec 23, 2002 8:25 am Post subject: |
|
|
I coded a cabinet extractor a few years back, and back then it turned out that when
you want to follow the cabinet chain, you shouldn't use PRECOPY1.CAB as the 1st
cabinet file searched - then you'll only search the precopy cab files.
Instead I used BASE4.CAB as the first cab file in Win98. In W95 it was WIN95_02.CAB,
and in WinMe BASE2.CAB. So you'll have to check it out for every Windows version
that you want to target.
If your file isn't found that chain you can try to find it in the precopy files or in MINI.CAB which
is outside the normal cabinet chain.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Dec 23, 2002 1:44 pm Post subject: Thanks, Mac and Dr Dread for the feedback |
|
|
Thanks, Mac and Dr Dread for the feedback.
| Quote: | you shouldn't use PRECOPY1.CAB as the 1st
cabinet file searched - then you'll only search the precopy cab files.
|
You are correct, Dr Dread, I discovered this fact a few days ago as I worked thru various codes.
In this instance the Hwinfo.exe is located in PRECOPY1.CAB location.
My Win98 SE Version 4.10.2222 starts at Win98\Win98_21.Cab.
My Win98 Upgrade Version 4.10.1998 starts at Win98\Win98_22.Cab.
The basic structure is maintained within both CD's
I suppose the solution that would be most simple and safe; would be to use a wildcard to search all Cabs. However, if there was a constant strategy that MS used for zipping files...our searches would be faster.
Is it possible to use a wildcard with the EXTRACT Command?
The below line of code does not work using "*" as wildcard.
| Code: |
runh Extract /Y /A %%drive:\win98\*.cab Hwinfo.exe /l c:\AAA
|
It seems that the Win98 Install Disks/CD files will not always be in the same Cabs. Hopefully, the basic structure would be constant in finding a file on MS Win Disk/CD?!
I discovered many MS files are not always in the same Cabs from Win98 Upgrade to the Win98 SE. I imagine it only gets worse if all the facts were known.
It would be great if this need for "Extract Utility" becomes apparent to everyone...and open source the code with constant improvement from the more experienced vds programmers; Or if one great vds programmer took it on himself and then market the finished code. I would be in line to purchase it. I would always be willing to purchase perfected code then beat myself up trying to reinvent what's already been done. Just a thought!
Win98 SE Version 4.10.222 has the following Cabs:
Base4.Cab - Base6.Cab
Catalog3.Cab
Chl99.Cab
Driver11.Cab - Driver20.Cab
Mini.Cab
Net7.Cab - Net10.Cab
Precopy1.Cab - Precopy2.Cab
Win98_21.Cab - Win98_74.Cab
Win98_ol.cab |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|