Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: von Pilsner on January 02, 2009, 09:42:31 am

Title: Compressing the Freespace .exe files
Post by: von Pilsner on January 02, 2009, 09:42:31 am
I compressed the Freespace .exe files with UPX and here are the results. I don't know if it matters too much to anyone to reduce the size of the .exe files, but I thought I'd mention it.

I have used UPX .exe packer (http://upx.sourceforge.net/ (http://upx.sourceforge.net/)) before and it doesn't make AV scanners mad or anything... =) (some packed .exe files throw up a false positive on some AV software). Also, source code is available and it is cross-platform compilable.

I usually call it with a batch file (Win32) but a simple Linux script would be easy to write.

Contents of upxall.bat (Win32)
Code: [Select]
@echo off
upx --best --compress-icons=0 --nrv2d --crp-ms=999999 -k *.dll *.exe
echo Press ctrl+c to quit now or any other key to delete old (uncompressed) files...
pause
del -f *.*~

Uncompressed (original) .exe files
05/25/2008  09:36 AM         3,219,456 fred2_open_3_6_10.exe
05/25/2008  08:43 AM        10,899,567 fred2_open_3_6_10_debug.exe
05/25/2008  09:36 AM         3,346,432 fs2_open_3_6_10.exe
05/25/2008  08:41 AM         7,854,293 fs2_open_3_6_10_debug.exe
               4 File(s)     25,319,748 bytes

Compressed .exe files
05/25/2008  09:36 AM         1,231,360 fred2_open_3_6_10.exe
05/25/2008  08:43 AM         2,115,584 fred2_open_3_6_10_debug.exe
05/25/2008  09:36 AM         1,298,944 fs2_open_3_6_10.exe
05/25/2008  08:41 AM         1,509,888 fs2_open_3_6_10_debug.exe
               4 File(s)      6,155,776 bytes

I have been using the compressed Freespace .exe files for a few days now and haven't noticed any problems...
Title: Re: Compressing the Freespace .exe files
Post by: chief1983 on January 02, 2009, 03:50:22 pm
This might be neat to look at sometime, but I'm afraid the gain might not be worth the risk of another layer with a chance of creating problems.  The builds themselves are distributed 7-zipped or RARed and I doubt the archive would get much smaller, but those who keep a lot of different builds in their folder might benefit from the space saved.  I just don't know if there's a lot of people who keep all those unarchived builds around.  I know I usually delete most of the ones I'm not using.
Title: Re: Compressing the Freespace .exe files
Post by: Nuke on January 03, 2009, 05:58:06 am
i keep lots of builds around because some of my scripting demos only work on one particular build, and i like to keep those around for testing purposes. but i really dont have a need to compress them. i usually only let my hard drives get 1/4 full before i get a new one and really dont like to be bothered with compression.