Wishlist: exit when extraction complete

When run via batch file, uniextract exits immediately, after which extraction occurs. The next step in the batch file generally operates on the extracted directories. That's a problem, because they don't exist yet.

A workaround for batch files is adding a fixed delay, e.g.

uniextract nsispackage.exe dir
sleep 8
(operations on dir)

The problem with this workaround is that uniextract takes a different amount of time to extract each exe. To be on the safe side, the delay must be chosen long enough that there is dead time.

Could uniextract be changed to exit when extraction is complete rather than immediately? IMHO that would make uniextract more useful for scripts.

If this change can't be made, how about adding an option to uniextract's installer to append uniextract's bin subdirectory to %path%? That way, a user could extract (for example) an nsis exe with the following code:

cmdtotal instexpl.wcx x nsispackage.exe dir
(operations on dir)

No fixed delay is needed, since cmdtotal does wait until extraction is complete before exiting.

This doesn't seem right. UniExtract.exe definitely continues running until extraction is complete. It has to. After extraction it does some validation stuff to ensure that it was a successful operation, deletes the log file if no errors were detected, etc. I think the issue you may be seeing is that when called from a command line, control is immediately returned to the command line rather than waiting until execution of the program is complete. This is because UniExtract is a GUI app vs. a CLI app. The same behavior occurs with any GUI app. Try running calc.exe from cmd.exe. You'll be returned to the command prompt immediately after executing it, even though Calc is still running.

I think you can work around this by using start /wait to launch UniExtract. This method forces batch files to wait until a GUI app has completed before continuing execution. Try something like this: start /wait uniextract.exe package.exe /sub. I'm running Linux right now so I can't test that myself, but I think it should do what you need, without requiring that ugly sleep timer approach.

--
http://www.legroom.net/

Thanks! You're absolutely right! Start /wait does the trick.

To help educate people like me, could it be worthwhile to add something like the following to (1) uniextract's /help dialog box and (2) "Installation and Usage" at http://www.legroom.net/software/uniextract?
Batch file usage is start /wait uniextract [args], which pauses the batch file until extraction is complete.

Gonzo (not verified)

Thu, 03/12/2009 - 16:44

Hello, I had some trouble extracting large binaries (hundreds of MB) with uniextract 1.6, because of the cmdTotal timeout feature :

cmdTotal 1.02 (c) 2006/2007 KaKeeware, http://www.kakeeware.com
Using plugin: InstExpl.wcx
Using option: x
Processing file: G:\package.exe
Target directory: G:\package\uni_gdcprlz
Sorry, program didn't stop after 300 seconds -> quitting!

I searched for some kind of configuration file or CLI argument to override this, until I found the variable was hardcoded into the assembler...

-- Technical note -- (cmdTotal.asm, lines 25-27)
There's a guard thread created at the beginning of the main routine that will kill the instance of cmdTotal, if the main thread haven't finished its work after 300 seconds.

If you ever find yourself in such a situation, dont panic! Here is a simple workaround :

  1. Download cmdTotal 1.02 sources from official page http://www.kakeeware.com/i_cmdtotal.php and extract it somewhere comfy
  2. Download and install the development environment for assembler MASM32 from http://www.masm32.com
  3. While installing, use your favorite text editor and open cmdTotal.asm
  4. Choose a timeout value that'll fit your needs, I found 900 sec (=15 min) to be enough for me, then edit the following lines with it :
    • line 27, in seconds
    • line 181, in sec
    • line 437(*2), in msec then in sec
  5. Save your modifications, check if MASM32 installation finished properly, then execute c.bat (edit it before if you didn't installed in c:\masm32\)
  6. If no error shows up, you should have a shiny, brand-new, custom cmdTotal.exe ready to go !
  7. Go to c:\program files\universal extractor\bin or wherever you installed uniextract, rename the old cmdTotal.exe to something like cmdTotal.bak before copying yours.

You're all done ! :D

Maybe this could be included in a future release of uniextract? Did this tiny glitch already happened to someone before?
Anyway, thank you very much for this nice piece of software ! ;)

Add new comment

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <acronym> <blockquote cite> <br> <cite> <code> <dd> <div> <dl> <dt> <em> <img src alt title height width> <li> <ol start type> <p> <pre> <span> <strong> <sub> <sup> <ul type>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.