PDA

View Full Version : Some TUT for UHARC CMD



hulkbuster
August 2nd, 2009, 04:35 AM
hey folks this is my first post,,,
i need some help regarding UHARC CMD v0.6b,http://mulder.dummwiedeutsch.de/pub/downloads/UHARC_GUI.2007-01-19.zip i want to use UHARC in command line. Suppose i h a folder name Bioshock, in D: n i want to save it in D: itself. What would be the command line n what strings should i give for max compression.
i can do basic things in command prompt, but i m not getting a hang of this thing
Anyhelp here would be a great help here....:wink1:

hulkbuster
August 2nd, 2009, 11:02 AM
no one has ever used UHARC, check this forum, which praises highly of UHARC, n mentions some command line , which i failed to understand....plz check this http://www.flexbeta.net/forums/index.php?showtopic=1075

hulkbuster
August 3rd, 2009, 05:16 AM
BUMP:smirk:

Tic3
August 3rd, 2009, 05:29 AM
I've never used UHARC, although many years ago it was used by some of the game hacking/cracking groups such as Class to compress the media files in large games.

I did a Google search for UHARC COMMAND LINE. This is from the very first search result to display:

For commandline help type "UHARC" without any parameter.

Usage: UHARC command [-switches..] archive[.uha] [filespec..@listfile..]

That search result also shows a listing of the commands and switches.

http://www.flexbeta.net/main/printarticle.php?id=27


Other than that, I can't help you. Maybe someone else can.

sag47
August 4th, 2009, 07:21 AM
Copy the BIOSHOCK folder (or what you want to compress) into a folder by itself. Then run the following command from within that folder:

uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ "compressed.uha"
Command explained:

a switch is for creating an archive.
-aeH+S+ is the attribute exclusion switch which excludes hidden and system files. This is basically to ignore compressing annoying system files like desktop.ini or thumbs.db which sometimes muck up decompression if not handled properly.
-ed+ stores empty directories.
-mx sets the compressor to highest compression (PPM Compression). Although ALZ:3 (-m3 switch) has been known to have a higher compression on rare occasions than PPM.
-md32768 sets UHARC to largest possible dictionary size. This is better for very large archives and doesn't really affect small archives.
-mm+ turns on multimedia detection and compression.
-op will prompt user before overwriting files.
-y- disables the auto-answering of yes when UHARC needs to prompt you. -y+ can be set instead to run it in a more silent mode.
-r+ has uharc compress all directories of the current folder recursively. Which is why I told you to put your BIOSHOCK folder into a folder by itself.


You can exclude specific file types by adding and exclamation switch at the end. For example if you want to exclude other .uha files then you would write !*.uha at the end of that command. Multiple file types can be excluded at the same time.

These are the best compression settings I've found through thorough experimentation with UHARC. I wrote the software UHARC CMD (http://www.pages.drexel.edu/~sag47/uharc/) if you want to check it out. For other GUI alternatives to UHARC check the bottom of the UHARC Wikipedia page (http://en.wikipedia.org/wiki/UHarc).

You can download the standalone commandline version of UHARC 0.6b by clicking the following link:
ftp://ftp.elf.stuba.sk/pub/pc/pack/uharc06b.zip

If you're not comfortable with using the commandline and wish to use a GUI then here's how you achieve maximum compression with UHARC CMD.

Open Start > UHARC CMD Compressor > UHARC Settings and make the settings look like the following image.
http://img44.imageshack.us/img44/3760/uharccmdbestcompression.png
Copy your BIOSHOCK folder into a folder by itself.
Right click on your BIOSHOCK folder and select Compress with UHARC.


Generally for all UHARC GUI frontend programs in a nutshell you want the following settings.
Compression mode: PPM
Recursive Directories: Yes/Always/Checked
Multimedia Compression: Yes/Enabled/Checked
Dictionary size: 32768

I randomly stumbled across this thread after a google search so I thought I'd answer your question.
Sam Gleske

hulkbuster
August 6th, 2009, 05:37 AM
Copy the BIOSHOCK folder (or what you want to compress) into a folder by itself. Then run the following command from within that folder:

uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ "compressed.uha"


i did like u said ,(Downloaded UHARC 0.6b) i tried compressing a small setup exe file first, i went to F:\test folder> uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ "compressed.uha"

But it says 'uharc' is not recognised as an internal or external program or batch file.
http://i429.photobucket.com/albums/qq12/pinso/Untitled-2.jpg
So i dloaded the standalone version, extracted them on F: n ran the same command , same results.
So i extract again on the test folder n ran from the CMD PROMPT, it started compressing all the 6 files with the setup.exe files. i m totally puzzeled. :surprised:
http://i429.photobucket.com/albums/qq12/pinso/Untitled-1-3.jpg:wave::wave::wave:

Any suggestion please, i was thinking if i get to understand this program from CMD, i could make a VIDTUT n upload on youtube or something

sag47
August 6th, 2009, 06:20 AM
Well you have to do one of two things.
(easiest solution) Either copy uharc.exe into the folder C:\Windows\System32.

(recommended) Or you can create your own uharc binary folder like C:\uharc\ and copy all of the uharc files into there. Then add C:\uharc\ to your PATH environment variable.

Review this article for environment variables.
http://www.cs.usask.ca/~wew036/latex/env.html

I'd recommend editing the User Variables PATH instead of the System Variables PATH because the User Variables PATH only affects your login and the System Variables PATH affects everyone who logs in.

(without quotes) Edit the PATH variable and at the end of it add "C:\uharc\". There has to be a semicolon (;) separating each directory path in the PATH variable. So you may have to add ";C:\uharc\" at the end.

After that UHARC will be integrated into the Windows Command Prompt.

NOTE: There's other ways of tweaking UHARC with batch files without affecting your System CMD. You can view the source of UHARC CMD (http://www.pages.drexel.edu/~sag47/uharc/) and see how I did it; Just check the box to install the source when the software is installed (it's basically nothing but a set of batch files).

SAM

hulkbuster
August 6th, 2009, 08:55 AM
i think the easiest solution worked for me,:silly::silly::silly:
http://i429.photobucket.com/albums/qq12/pinso/asas.png
i tried following the recommened solution i.e.,integrating uharc. i tried editing or creating the User variable path, but got little puzzeled,

Edit the PATH variable and at the end of it add "C:\uharc\". There has to be a semicolon (;) separating each directory path in the PATH variable. So you may have to add ";C:\uharc\" at the end.

I'll be little honest, editing n changing the environment variables is little new to me,,, could u explain a little bit more(in pic or ex:).:scratchchin::scratchchin::scratchchin:
http://i429.photobucket.com/albums/qq12/pinso/how.png
hope i'm not asking too much !
cause i think many novice uharc cmd users will benefit from this thred, as their are very little material on this subject. :nervous::nervous::nervous:

sag47
August 6th, 2009, 08:48 PM
That's ok I don't mind teaching people who are willing to learn. Most of the stuff I've been saying here I've had to figure out on my own or browsing and sorting through other open source code.

Please be aware that the following tutorial is in relation to Windows and there would be no reason for UHARC to document it.

Even though these are Vista screenshots it should look the same for all NT/2000/XP/2007.

I notice that the screenshot of your user environment variables doesn't include the Path variable. That's an easy fix.

In this dialog: http://i429.photobucket.com/albums/qq12/pinso/how.png

Click on new and give it the following settings.
Note: In Windows the environment variables (like folder names and structure) are not case sensitive so it doesn't matter if you name it Path or PATH.

Variable name: PATH
Variable value: c:\uharc\
Screenshot: http://img16.imageshack.us/img16/9291/pathvariable.png

In the future if you want to add more folders to the Path variable simply separate each folder path with a semicolon.
Variable value: c:\uharc\;c:\folder2\

Environment variables can be accessed by the system with global variables.

For example if you have an environment variable named EXAMPLE_VAR then in the command prompt you can access that environment variable by typing %EXAMPLE_VAR%.

In the windows command prompt there are temporary environment variables and permanent environment variables. Here's a small experiment.
Click Start > Run Command... and type cmd and hit enter.
Now type the following command sequence.
set sam=hello
echo %sam%
The echo will say "hello".
Screenshot: http://img10.imageshack.us/img10/8930/envvarexperiment.png
Now close the command prompt and open another.
If you type echo %sam% then it will not echo "hello" any more because that was a temporary environment variable which was just for that instance of the command prompt.


Check out this screenshot of my System and User PATH environment variables.
http://img21.imageshack.us/img21/2406/envirnmentvars.png
Please note that under System variables the Path environment variable includes C:\Windows\System32. That is why the "easy solution" worked for you because the System32 folder is included in the PATH variable by default on all Windows systems.

If you go into the command prompt and type echo %path% you'll see that the %PATH% variable contains the information from both the User PATH variable and the System Path variable.
Screenshot: http://img7.imageshack.us/img7/8441/pathecho.png

sag47
August 6th, 2009, 09:22 PM
Also if you wanted to compress a folder but don't want to modify your system variables then copy BIOSHOCK into a folder by itself.

C:\New Folder\BIOSHOCK\

Copy UHARC.EXE into the same folder
C:\New Folder\UHARC.EXE

Now you can run the following command from within C:\New Folder\ and exclude compressing UHARC.EXE

uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ "compressed.uha" !uharc.exe

Reading all the documentation that comes with UHARC 0.6b will help anyone to better understand how it works. That's how I learned how to use it. Also typing uharc in the command line without any arguments will give you additional information on how to use the UHARC command.

SAM

hulkbuster
August 8th, 2009, 02:02 AM
Thank you Sir, i m really obliged , thank u for acknowleding my request, the methods u oulined worked, it integrated smoothly with winxp, :You_Rock_Emoticon::You_Rock_Emoticon:

uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ "compressed.uha" !uharc.exe
Even this method worked while compressing the file n excluding the uharc.exe.:fing02::fing02::fing02:

After the compression, i could just right click on any uha file, n convert to sfx by uharc v6. Standalone n V6 seems to go hand in hand...That is what i was doing n no problem while decompressing...:dance:

The reason for me trying my hands on uharc was because, i read many,many, many discussions n topics about uharc, compressing a 2 GB PC GAMES to 375 MB, 600MB setup files to 45 MB, n so on...
Since i wanted to upload many files, i thought uharc should be the one for me.....
After a few days , i'll come up with a VID TUT,:veryhappy:
Thank you Sir, once again for extending ur hand for help. I think my problem is solved.:fing02::notworthy::notworthy:

Signa
August 8th, 2009, 04:00 AM
That's some awesome compression. Any idea how it compares to 7-zip? I downloaded a collection of SNES games that shrank 17GB down to about 2GB. I've been in love with it ever since.

sag47
August 9th, 2009, 01:08 AM
Last time I checked it does a little better compression than 7z. But it takes longer to compress/decompress at max settings than 7z because 7z can multithread.

Edit: 7z seems to have gotten a little better since I last used it.

I have a small 37 MB program (Blender Portable) which was uncompressed. I compressed it using a couple of formats and here's the results...

Uncompressed: 37.4 MB
ZIP (Best Settings from WinRAR): 17.8 MB
RAR (Best Settings from WinRAR): 16.0 MB
UHARC (Used above recommended settings): 11.7 MB
7z (Ultra Settings from 7-ZipPortable): 11.6 MB

7-Zip seems to have gotten better since I last used it. I only did one trial and didn't use a variety of any files or programs so my guess is now 7-Zip and UHARC are comparably hand in hand with high compression. It's taken a long time for it to get to this point but I'm impressed with 7z.

I also came across a UHARC limitation with UHARC v0.6b. I was trying to compress a 4GB game and UHARC aborted with the following error:

UHARC 0.6b ----- high compression multimedia archiver ----- BETA version
Copyright (c) 1997-2005 by Uwe Herklotz All rights reserved 01 Oct 2005
**** Freeware for non-commercial use **** contact: [email protected] ****

ERROR: Archives larger than 2 GB are not supported !

Process aborted.

But 7-Zip seems to be able to compress it just fine. It seems to me that UHARC is a little bit outdated and if you want to compress anything larger than 2GB of data into a single UHARC archive then you'll have to split it up into parts.

Signa
August 9th, 2009, 01:39 AM
Good info. Thanks.

hulkbuster
August 11th, 2009, 12:20 AM
This is the TUT i came up with ,,,http://www.youtube.com/watch?v=eP7rXOgjtaQ
Still h' one video to make:

sag47
August 11th, 2009, 09:18 AM
You can also create an SFX (self extracting archive) using the UHARC command line version. All you need to do is add the -sfx switch to the command.

uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ -sfx "compressed.exe"

Please NOTE: UHARC requires that UHARCSFX.EXE be in the same folder as your UHARC.EXE.

So if you copied UHARC.EXE to your System32 folder then you'll need to also copy UHARCSFX.EXE for that command to work.

If you wanted to compress a folder to an SFX but don't want to modify your system variables then you'll need to have UHARCSFX.EXE in the same folder as UHARC.EXE and then exclude it in the command as well.

uharc a -aeH+S+ -ed+ -mx -md32768 -mm+ -op -y- -r+ -sfx "compressed.exe" !uharc.exe !uharcsfx.exe

I know that UHARC already has SFX capabilities built in but I created my own custom SFX because it is more aesthetically pleasing to the end user.

SAM

hulkbuster
August 22nd, 2009, 04:32 AM
I think i'll add ur mentioned command on the next Video TUT,,,,,

sag47
August 22nd, 2009, 04:17 PM
what program do you use to record/edit the videos?

hulkbuster
September 19th, 2009, 01:10 PM
i m using Camstasia 6:
Download with Serial Intact:


Enjoy:

(Edited out Rapidshare file url.)

hulkbuster
January 9th, 2010, 03:36 AM
Ok, i just Ripped a CIV III Gold Edition PC Game , which was a total of 1.74 GB, and compared by Winrar,
CIV III Gold Edition: 1.74GB
Winrar:1.17 GB
UHARC:865 MB

Hope i m not violating the Forums Rule by posting this Reply. i just ripped to save countless time to remove the Game CD from the box, n starting frm scratch.
Hope u'll understand.

Anyways: can someone advice how i can create a Batch file for this UHA file.
My guess:


@echo off
cls
echo unpacking the archive, please wait!
uharc X -d2 -pr -y auth.uha

I want to extract this uha file to c:\Programfiles\Atari
Any Advice.

Signa
January 9th, 2010, 03:28 PM
Hope i m not violating the Forums Rule by posting this Reply.

Oh you are SO banned Hulkbuster, let me just find my ban hammer... Aw damn, I'm too lazy to find it right now.

hulkbuster
May 9th, 2010, 01:14 PM
Hello sir(sag47), i think i m happy with UHARC now: compressing huge files especially to make this so-called Ripped Games and also for other purpose has sufficed my Query.
I found one site where this user(Moderator) gives some TUT for making Ultra compressed files: using UHARC 0.6vb (Stand alone)
Check this Site: (http://www.syshacks.com/showthread.php/9662-Ultra-Lossless-Compression-Using-UhArC-0.6vb)

uharc a -r+ -ed- -pr -m3 -mm+ -md+ -md32768 -b4096 cs16 "D:\Counterstrike 1.6\*.*"
It uses 300 MB and 4 MB for File Buffer.

I want to see how well it compresses CIV III Gold Edition:(default size) 1.74GB
(Also i got around making a Batch file which i feel is much quicker than using the GUI)

@echo off
cls
UHARC.EXE x CIV III Gold Edition.uha

Will soon give my comparison :
(Keep this thread alive)