How to compress executables into smaller size – UPX

NOTE: for experienced users only. if shits happen, at least you will know what to do.

UPX is a nice small tool to compress executables into smaller size. this makes them load faster. with the most common hardware today (i.e. fast CPU and abundant RAM), this is a good thing to do.

for instance, this is how i compress my Mozilla Firefox in Microsoft Windows:

  1. first, make sure Firefox are not running.
  2. download upx from sf.net. get the windows version (archive filename should be something like upxxxxw.zip).
  3. open the zip file and extract only upx.exe (this is the only executable that you need to do the job)
  4. my firefox was installed in c:\Program Files\mozilla\firefox. so i put upx.exe inside the folder (actually, i put it into my folder that store essential files, and then i put the folder path into my user-only PATH environment variable. this means i can access them anywhere in command prompt just by typing the file name, instead of full path).
  5. run command prompt. in Windows 7 (or Vista), you can do this by clicking on the start button > All Programs > Accessories > right-click on the Command Prompt and select “Run as administrator” (you need to make sure that the command prompt is run under the privilege of administrator, unless you have turned off UAC entirely)
  6. change the current directory to your Firefox installation folder. for me that means typing cd “c:\Program Files\mozilla\firefox”
  7. when you are in the correct directory, type the following, and let it run until it stops:
    for %v in (*.exe *.dll components\*.dll plugins\*.dll) do upx “C:\Program Files\mozilla\firefox\%v”
  8. that’s all.

you can try it on other applications too. but bear in mind that if shits happen, it’s not my fault.


Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Translate

Buy me a Caffè Latte

Thank you for the Caffè Latte

2013/02/15 saw art
2013/01/25 Parul Patel
2012/11/20 Barbara Nicholas $10
2012/10/08 Amy Stockman $5
2012/07/15 siewho chang $ 50
2012/06/08 Susan Hampton $10
2012/05/11 Chris Grima $10