3

Our application is distributed as a zip file, with a small bat/shell script that the user runs after extracting the archive to install the application. This zip file is currently created via mavens assembly plugin.

The zip file we distribute contains a lib folder with an executable jar, as well as all the files we need as part off the deployment off the actual application.

What we want is a self extracting zip-file that executes that contained bat file after the zip file has been extracted. And this should be created as a part off the build process.

I have read creating-a-self-extracting-zip-archive-on-a-linux-box, and can do that. But I don't see anywhere how to also execute a bat file within the extracted archive when it's done.

I have found winzip self-extractor, but I would prefer something that can be run on any platform. The build server and some developers use linux. I also found some VB code which leads me to believe that there might be some autorun properties on zip files.

Community
  • 1
  • 1
Staale
  • 27,254
  • 23
  • 66
  • 85

4 Answers4

3

Did you consider using IzPack (and the IzPack Maven Plugin) to generate a cross-platform installer?

vegemite4me
  • 6,621
  • 5
  • 53
  • 79
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • Yes, however there is a current installer app, and that would mean rewritting the installer to be an IzPack installer. I would want to do that in the future, but right now the app is both an installer and an application manager. So it serves as more than an installer. – Staale Dec 15 '09 at 09:22
1

The previous replier suggested lzpack, it's documentation contains the following pointer:

""The 7-Zip project (see http://www.7-zip.org/) provides a so-called SFX for installers, i.e., an image that can be use to create self-extracting Windows executables. Once its content has been extracted, such a self-extracting executable can launch an executable or a file. In the later case, it is assumed that there exists an association between a file extension and a software component.""

7-zip is cross platform, although I haven't tried whether you can build sfx files for windows on linux.

dirkjot
  • 3,467
  • 1
  • 23
  • 17
0

The 7zip manpage says you can do this.

EXAMPLE 2
       7z a -sfx archive.exe dir1
              add all files from directory "dir1" to  SFX  archive
              archive.exe  (Remark  :  SFX  archive  MUST end with
              ".exe")

cokedude
  • 379
  • 1
  • 11
  • 21
0

While it's a bit late:

We just released a Maven plugin that can do this (docs at https://zephyr.sunshower.io/site/). It's free, open-source, and permissively licensed.

We bundle a JRE with our application using this plugin, then launch an IzPack installer with that JRE. It also supports code-signing, which we expect to have documented within the week.

  • 1
    Link-only answers are discouraged on Stack Overflow, as they are rendered useless if the link stops working or the content significantly changes. You should [edit] your answer to include the most important information that's relevant to the question in the answer itself. Answers that are little more than links to an external site may end up being deleted. – Hoppeduppeanut Jul 08 '20 at 02:55
  • Sorry--new to StackOverflow. I'm happy to edit this, but the process is somewhat involved and quite dependent upon this particular solution, hence, if the link goes away then the solution will. Do you have a recommendation as to how I should proceed? – Josiah Haswell Jul 08 '20 at 03:21
  • You don't need to remove the link, however your answer does need to be able to stand on its own without needing to use external links. Any links you *do* include should only be included to supplement information contained in the answer itself. In this situation, you could probably include some code examples or specific documentation sections that are relevant to the question in your answer. – Hoppeduppeanut Jul 08 '20 at 04:02
  • There's thousands of lines of actual code assembled in a specific way that constitutes an answer to this question that has been without one for 3 years. I saw this question before I wrote that program, and could not find any. To rephrase, /this/ is the answer that I've found/created. I don't perceive it as worse than the others to this question because they're also essentially "well, use this open-source project" without describing the solution here. If SO doesn't want this answer, so be it--the alternatives are worse. I can't copy/paste documentation that will certainly change. – Josiah Haswell Jul 08 '20 at 04:23