Archive: Has Anyone Else Thought of This?


Hi guys,

NSIS is great for turning a set of program files into only one file! This one file can also be smaller than the set of files too.

I have a Mini Golf game that takes up ~900KB. With NSIS I have turned it into a ~380KB file.

Here's my code:

!PackHdr TEMP.DAT "UPX.EXE --best TEMP.DAT"
Icon MINIGOLF.ICO
OutFile MiniGolf.exe
SilentInstall Silent
CRCCheck On

Section Default
SetOutPath "$TEMP\MiniGolf"
File G_I.ZRF
File G_4W.ZRF
File G_123.ZRF
File G_WAR.ZRF
File G_WW.ZRF
File GOLF.EXE
File GOLF.ZRF
ExecWait GOLF.EXE
RMDir /R "$TEMP\MiniGolf"
SectionEnd

If you want your game to be smaller, you can also use UPX on your exe file (this will compress the Exe, and decompress it when you run it). It's at http://upx.tsx.org
At maximum compression, the exe file is smaller than with NSIS compression (combining the two of them is best).


Yeah...I though of that, but it's a 16-bit game.

The NSIS documentation says a lot about using -9 to compress the header, but there's another option to make it smaller: --best.


Doesn't UPX compress all exe files, including 16-bit?


Err...I'm pretty sure it doesn't. Hang on...

Well, I mean 16-bit as in something that will run under Windows 3.1. I thought that was what 16-bit meant...oh well...

Yeah, I run UPX on this file and it tells me:

CantPackException: can't pack new-exe