Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 15 of 15
  1. #1
    Join Date
    Apr 2005
    Location
    Milan
    Posts
    15

    Grin Zip.Extract question!

    hi,

    i have to extract from a zip file some files. i've used zip.extract action, and a callbackFunction to show the progress of operations. The problem is that the var "Percent" of the callbackfunc. shows the "progress status" for every file in the zip. is that possible to have a status percent. that corresponds to the progress of the action as a whole (for all files)?

    i hope i've explained myself.

    thanks

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by odeen_c
    hi,

    i have to extract from a zip file some files. i've used zip.extract action, and a callbackFunction to show the progress of operations. The problem is that the var "Percent" of the callbackfunc. shows the "progress status" for every file in the zip. is that possible to have a status percent. that corresponds to the progress of the action as a whole (for all files)?

    i hope i've explained myself.

    thanks

    As part of the callbackfunction look at the status field. This is from the help file.

    Status
    (number) The status of the current callback message. Either ZIP_STATUS_MAJOR or ZIP_STATUS_MINOR. ZIP_STATUS_MAJOR means that the callback corresponds to the progress of the action as a whole. ZIP_STATUS_MINOR means that the callback corresponds to the progress of the current file.
    Check to see if it is ZIP_STATUS_MAJOR or ZIP_STATUS_MINOR and only use the ZIP_STATUS_MAJOR to show the progress of the extraction as a whole.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Apr 2005
    Location
    Milan
    Posts
    15
    I did it in another way.
    however, the var "Status" doesn't give me a percentage of the progress but only "1" for ZIP_STATUS_MINOR and "0" for ZIP_STATUS_MAJOR.

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by odeen_c
    I did it in another way.
    however, the var "Status" doesn't give me a percentage of the progress but only "1" for ZIP_STATUS_MINOR and "0" for ZIP_STATUS_MAJOR.
    That is correct. This status determines if the returned percentage is for an individual file or for the zip file as a whole. So you can perform an if then statement to see if it is Major and if it is then use it to update your progress bar as appropriate.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  5. #5
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Here is an example (I.R. member Desmond did this one):

    Code:
    function CallBack (sPath, nPercent)
    	--if one file is done, incriment the current file
    	if nPercent == 100 then
    		nCurrentFile = nCurrentFile + 1;
    	end
    	--this statement prevents incorrect display (eg 3of2)
    	if nCurrentFile <= nEnd then
    		StatusDlg.SetTitle("Unzipping!!!");
    		StatusDlg.SetMessage(sPath);
    		StatusDlg.SetStatusText("File " .. nCurrentFile .. " of " .. nEnd .. ".");
    		StatusDlg.SetMeterPos(nCurrentFile);
    		StatusDlg.SetMeterRange(1, nEnd);
    	end
    end
    
    --get the contents of the zip file
    tFiles = Zip.GetContents("AutoPlay\\Docs\\file.zip", false);
    
    --these variables are used in the callback function
    nCurrentFile = 1;
    nEnd = Table.Count(tFiles);
    --end callback function variables
    
    --unzip the files
    StatusDlg.Show(0, false);
    Zip.Extract("AutoPlay\\Docs\\file.zip", tFiles, _TempFolder, false, false, "", ZIP_OVERWRITE_ALWAYS, CallBack)
    StatusDlg.Hide();
    Intrigued

  6. #6
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Here is a sample project showing the use of nStatus within a project.
    The zip file will be created on the project startup. I also have a sleep command in the callback function to slow the process down so it is easier to watch. Just comment it out to have it go faster.

    Tigg
    Attached Files
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  7. #7
    Join Date
    Aug 2006
    Posts
    13
    nice work tigger !!! ,
    but is it possible with a .exe when installing???

    please with an example????

    noob scripter in here

  8. #8
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by odracir
    but is it possible with a .exe when installing???
    I don't understand your question.

    Can I make the project an EXE and have it do the same thing? Sure
    Can I extract files from a self-executing zip archive? don't know have not tried
    Can I show the status dialog when installing from an EXE file? Not that I am aware of.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  9. #9
    Join Date
    Aug 2006
    Posts
    13
    i made a file with sfx to .exe file....
    when on button click,
    it runs the same as the zip extraction.
    so when installing you see the progress running.....
    and is it possible to change the color of the progressbar???


    greetz ricardo

  10. #10
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Quote Originally Posted by odracir
    greetz ricardo
    I'm guessing that you're 'clubcrusher' in disguise. Just a guess -


    http://indigorose.com/forums/showthr...ghlight=greetz

  11. #11
    Join Date
    Aug 2006
    Posts
    13
    who's that ron???

    greetz is like greeting term in holland ????

  12. #12
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    lol

    It's hard to get one past Ron. Maybe I.R. should let him Admin the boards.

    Intrigued

  13. #13
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Quote Originally Posted by odracir
    nice work tigger !!! ,
    but is it possible with a .exe when installing???

    please with an example????

    noob scripter in here
    This may work for you.

    I adjusted TJ_TIGGERs code a bit for the following example:

    Updated (forgot to add in TJ's zip file):

    http://www.amsuser.com/ams/examples/...-Intrigued.apz

    Note: I set the files to unzip to a folder on the user's Desktop for easy visual and then removal as well.
    Last edited by Intrigued; 08-01-2006 at 08:03 PM.
    Intrigued

  14. #14
    Join Date
    Apr 2005
    Location
    Milan
    Posts
    15

    thank you!

    Quote Originally Posted by TJ_Tigger
    That is correct. This status determines if the returned percentage is for an individual file or for the zip file as a whole. So you can perform an if then statement to see if it is Major and if it is then use it to update your progress bar as appropriate.

    Tigg
    oh hadn't seen it like this. ill try it.

    thank you very much. and thanks to intrigued too.

  15. #15
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Ya, TJ get's the lion's share of the credit on that one. But, you are welcome.
    Intrigued

Similar Threads

  1. Math.RandomSeed() question
    By stickck in forum AutoPlay Media Studio 6.0
    Replies: 8
    Last Post: 06-09-2006, 09:42 AM
  2. Question: reg question
    By mjheijster in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 07-22-2005, 04:01 AM
  3. FlashMX vs AMS5 Data Arrays question
    By Martin_SBT in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 01-19-2004, 09:05 AM
  4. question about sound mp3
    By Rapido78840 in forum AutoPlay Media Studio 4.0
    Replies: 4
    Last Post: 10-10-2003, 11:19 AM
  5. ** Question for all AutoPlay Menu Studio Users **
    By Ted in forum AutoPlay Menu Studio 3.0
    Replies: 4
    Last Post: 10-09-2000, 09:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts