8

I am working on some Linux application. It is the right moment to start thinking about deployment. So my question is:

How to create a one file installer like for example *.run or *.sh files that sometimes can be found in internet (for example nVidia drivers or Wolfram Mathematica CDF).

derobert
  • 107,579
  • 20
  • 231
  • 279
Misery
  • 233
  • 1
  • 2
  • 6
  • 3
    Usually you should not do that, just let distro maintainers to create package for your software, or do it yourself for few popular distros. Installing software via any means other than package manager is discouraged, since it makes hard to update software and avoid conflicts. – gelraen Apr 02 '13 at 09:29

6 Answers6

14

Just use makeself, it creates a shell script with an included archive and can run commands after extraction.

Ulrich Dangel
  • 25,079
  • 3
  • 80
  • 80
7

If you need only a self-extracting archive, you can use shar.

e.g.

shar -z -t files/ > bundle.sh
jofel
  • 26,513
  • 6
  • 65
  • 92
5

Create a package for each targeted distribution. "One file installer containing the bathtub and the kitchen sink, in case they aren't installed already" is very bad manners. Perhaps this is relevant here.

Distributions have widely different policies on what to ship, configuration file standards, and how to package software. Better recruit some interested party knowledeable with the distribution, and have them take over the packaging and integrating into the distribution. That will reduce friction enormously.

vonbrand
  • 18,156
  • 2
  • 37
  • 59
  • Is it possible for example to detect compilers (or ask user for paths) when installing for example .deb or .rpm? if that is possible, that would indeed be a great solution. – Misery Apr 02 '13 at 14:59
  • .deb and .rpm install _binaries_, no compiler required. The respective .src.rpm (SRPM) contains the full configuration to build/install the package from source, there you can specify what you need to build. I'm not familiar with .deb, but AFAIU the repective source packages are similar. Or you could just ship a `.tar.gz` with installation instructions (perhaps add the [autoconfiscation configuration](http://www.dwheeler.com/autotools), it is a bear to set up but a breeze to keep up to date later). Leave the istalling to the user. – vonbrand Apr 02 '13 at 15:35
  • Well, the thing is that in my project compiler is needed. I am creating a C++ math library that will be autmatically installed and tuned for choice between serial and OMP algorithms. I am doing this for my colleagues at work, and some of them use GCC, some Intel compiler, some Borland, some work on Windows using MSVCC etc. Some have i7 some have Opterons and so on. So libs should be compiled with their compiler, and tuned. Also some have Intel MKL, and others do not. Some of them wish to use it, and some not. So it is the only way to write somewhat interactive installer. – Misery Apr 02 '13 at 16:01
1

Try the CQtDeployer tool. This tool using the Qt Installer Framework for create installers and supports Windows and Linux platforms.

  1. Install the cqtdeployer tool. I am recommended use the online installer, because it has the latest version of cqtdeployer with minor bug fixes.
  2. Open the console with your framework envirement.
  3. Run the cqtdeployer for your application on the console.
cqtdeployer -bin path\to\myApp qif 

If you use Qt then add the qmake option.

cqtdeployer -bin path\to\myApp -qmake path\to\qmake qif 

For more examples of using this util see the CQtDeployer Wiki

1

Note that you should strive to create packages for the target distros, as mentioned in other answers.

But if you really want a graphical installer like on Windows, for this case I wrote linux_installer, a NSIS/Wizard97 lookalike using GTK3 on Linux.

grandchild
  • 206
  • 1
  • 5
1

Usually it's a bash script where you put an archive of your files at the end of the file. You add an md5 hash to check if file was downloaded correctly and add some operations at the beginning of the file to deploy your archive.

Edit: example with uudecode.

GHugo
  • 792
  • 4
  • 10