Results 1 to 7 of 7

Thread: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

  1. #1
    Join Date
    Jan 2008
    Location
    Espoo, Finland
    Beans
    41
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Wink Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    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.
    Last edited by Kajaste; November 27th, 2008 at 02:22 AM. Reason: new url for the win32 binary
    Kaja

  2. #2
    Join Date
    Jul 2008
    Beans
    1

    Smile Re: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    Hi Kajaste,

    I have the same problem, I'm searching for the solution from 4 days ago..

    before I used Zip2exe.exe to self extract from .zip to .exe, but this one is no longer supported by x64, so I'm searching for a alternative.

    I'd like to know where I can find unzipsfx.exe ? and can I call it from my C++ program ?

    Thanks

  3. #3
    Join Date
    Jan 2008
    Location
    Espoo, Finland
    Beans
    41
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    ftp://ftp.info-zip.org/pub/infozip/win32/ seems to be up again and unzipsfx.exe can be found in ftp://ftp.info-zip.org/pub/infozip/win32/unz552xn.exe (which in fact is a self-extracting zip file).
    Last edited by Kajaste; July 27th, 2008 at 07:57 PM.
    Kaja

  4. #4
    Join Date
    Feb 2007
    Location
    Nowhere important
    Beans
    1,198
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    Thanks for this, really helpful!
    ➙ Synchronize all your files across Windows, Linux and Mac OS with Dropbox (2GB free storage!). By signing up via this link I'll get some extra space also, thanks!

    Multiseat on Ubuntu 10.04

  5. #5
    Join Date
    Nov 2007
    Location
    Fairbanks, AK
    Beans
    5
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    Hi! I have a similar need, to create a Windows self-extracting ZIP file from a Linux server. However, as these are intended to be used for an automated/unattended update process, I have two additional requirements that I'm hoping somebody can help me with:
    1) I need to specify a default directory to extract to. As the server this is being built on is Linux and the target will be Windows, simply telling zip to use the full path won't work - I need to be able to prepend an arbitrary path to the relative paths stored in the archive.
    2) I need to be able to set the option to extract automatically, i.e. when executed this archive must immediately extract its files instead of simply presenting the prompt asking if the default location is acceptable.

    Any help on these two issues would be much appreciated!

    Edit:
    I've solved question 2 - using unzipsfx.exe as the stub instead of SFXwiz32.exe provides an automatically self-extracting ZIP, but now I have the problem of needing it to replace existing files without asking.
    Last edited by Kromey; November 27th, 2008 at 02:48 AM.

  6. #6
    Join Date
    Oct 2005
    Location
    Peru, South America
    Beans
    1,486
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    I too would be very interested in this and googling for the answer. I often make a windows installer to install a data file in a specific directory. I have been using IZArc under wine because I can't find any Linux native way of doing this.

    Shane

    Ok in a quick search I dug up this:

    http://manpages.ubuntu.com/manpages/...nzipsfx.1.html

    This package is no longer active/existent and seems to have been incorporated into: unzip or zipinfo

    http://manpages.ubuntu.com/manpages/...1/unzip.1.html

    http://manpages.ubuntu.com/manpages/...zipinfo.1.html

    If someone was real good with man files they could probably figure out how to accomplish this with this info.
    Last edited by shane2peru; May 14th, 2009 at 12:12 AM.

  7. #7
    Join Date
    Feb 2007
    Beans
    9

    Re: Howto: create a Windows compatible (.exe) self-extracting ZIP file in Ubuntu

    I too was having trouble with this trying to create a free software package. Very useful post, thanks guys!! you rock

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •