Tom.DeVito 12.27.2010

Notes on self-extractors

Here are some ways to make self-extracting files in windows and linux.

Windows

  • No free viable solution so far…  Was going to use IExpress(this is what i was talking about last thursday), but you can only add files not directory structures which needless to say is terrible.
  • WinRar can make self-extracting files but they will not auto execute an installer.
  • Winzip self-extractor(not what comes with the standard winzip package) is a very good option but files made with the trial version are not licensed for distribution.  Full version cost $50.00

Windows is super annoying when it comes to compressing and decompressing files.  For whatever reason all of the more standard tools either don’t support directory structures or are not accessible via the command line.

Assuming that you are not trying to make a self extractor, and just want to compress or decompress files from within your program, the files found on this site will help:

http://stahlworks.com/dev/index.php?tool=zipunzip

Just drop them into your programs root directory and call it through the shell.  A lot of people like 7-zip for command line compressing and decompressing, but 7-zip needs to be installed in order to work whereas the zip.exe and unzip.exe files are completely self contained.

Linux

Linux is comparably much easier than windows.  I am pretty sure that all linux distributions come with tar.  Basically all you do is tar the file and then vi into it and add your self executing script to the beginning.  The tutorial above tells you to make a script that will run after decompression but this could be a program too.