Search code examples
7zipwinrarsfx

How do I make a self extract and running installer


So currently my users download a zipfile, unzip it and then run setup.exe - I would like them to do this with one click. Using http://www.wikihow.com/Use-7Zip-to-Create-Self-Extracting-excutables i can make a self-extracting exe, but it doesn't actually run the installer.

From this question

Why does 7zip Ignore my InstallPath when making a SFX installer?

it seems I also need an .sfx file so I copied from the other question and created one with the following contents

;!@Install@!UTF-8!
InstallPath="C:\\test"
GUIMode="2"
RunProgram="setup.exe"
;!@InstallEnd@!

and called setup.sfx and add this to archive together with the other files

setup.ini
setup.exe
setup.ico
install.jar
JVM32 (folder)

but it made no difference, what else do I need to do.

Supplementary question, I also have WinRar, does it effect the end user experience whether I use 7Zip or Winrar ?


Solution

  • Okay I have got it working, hope this information is useful.

    1. First of all I now realize that not only do self-extracting zip start extracting with doubleclick, but they require no extraction application to be installed on the users computer because the extractor code is in the archive itself. This means that you will get a different user experience depending on what you application you use to create the sfx

    2. I went with WinRar as follows, this does not require you to create an sfx file, everything can be created via the gui:

      • Select files, right click and select Add to Archive
      • Use Browse.. to create the archive in the folder above
      • Change Archive Format to Zip
      • Enable Create SFX archive
      • Select Advanced tab
      • Select SFX Options
      • Select Setup tab
      • Enter setup.exe into the Run after Extraction field
      • Select Modes tab
      • Enable Unpack to temporary folder
      • Select text and Icon tab
      • Enter a more appropriate title for your task
      • Select OK
      • Select OK

    The resultant exe unzips to a temporary folder and then starts the installer