The problem
A few days back I had to create a Win32 compatible self-extracting ZIP file for a friend. Sounds easy, right. The problem was that I didn't have a Windows machine nearby and I didn't want to install any archiving programs under Wine.
NOTE: A freeware ZIP program such as IZArc under Wine can be used to create a Win32 self-extracting ZIP file too. That will not be covered by this howto, sorry.
The "research"
Googling around I found this forum post dated August 2003. Reading it I found out that self-extracting ZIP files are nothing more but a suitable unzip binary followed by a normal ZIP file. I used the unzipsfx.exe included in Info-ZIP UnZip 5.52.
The link on that post worked a few days ago so I got my hands on the unzipsfx.exe that I was looking for. Today, 2nd July 2008 I found the link dead. After some googling I didn't find a working link anywhere. I read the licence a few times and understood that I can redistribute the original unzipsfx.exe with a license included.
Please note that the unzipsfx-552_win32.tar.gz (80 kB) is not an official Info-ZIP package and it includes copyrighted software that I take no credit for. More info in the Info-ZIP license that is also included in the tarball. The source code for the binaries included can be found here.
The solution
Step one, getting the unzipsfx.exe and zip package:
* open the Terminal (in Ubuntu press alt+f2 and type gnome-terminal)
* type in the following commands
Code:
wget http://kolmoskone.homelinux.org/~kaja/kamaa/unzipsfx-552_win32.tar.gz
tar zxf unzipsfx-552_win32.tar.gz
sudo apt-get install zip
Step two, creating a ZIP file in Ubuntu:
* open the file manager (nautilus) and select the files you want to have zipped
* right click and select Create an archive (or similar). Select a location for the ZIP file, using your home directory is the easiest. Select type .zip.
See man zip for information on how to create a ZIP file in command line.
Step three, making the ZIP file self-extracting
* type in the following commands
Code:
cat unzipsfx-552_win32/unzipsfx.exe MYZIPFILE.zip > mysfxfile.exe
zip -A mysfxfile.exe
mysfxfile.exe can now be opened in any Win32 compatible system (including for example Windows XP/2000/Vista and even Wine in Linux) or ANY ZIP COMPATIBLE archive program such as file-roller in Ubuntu.