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:
- first, make sure Firefox are not running.
- download upx from sf.net. get the windows version (archive filename should be something like upxxxxw.zip).
- open the zip file and extract only upx.exe (this is the only executable that you need to do the job)
- 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).
- 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)
- change the current directory to your Firefox installation folder. for me that means typing cd “c:\Program Files\mozilla\firefox”
- 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”
- that’s all.
you can try it on other applications too. but bear in mind that if shits happen, it’s not my fault.