Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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).

share|improve this question
1  
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 2 '13 at 9:29
add comment

4 Answers

up vote 9 down vote accepted

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

share|improve this answer
    
That is just awesome! Thanks! –  Misery Apr 2 '13 at 15:22
add comment

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

e.g.

shar -z -t files/ > bundle.sh
share|improve this answer
add comment

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.

share|improve this answer
    
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 2 '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, it is a bear to set up but a breeze to keep up to date later). Leave the istalling to the user. –  vonbrand Apr 2 '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 2 '13 at 16:01
add comment

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.

share|improve this answer
    
but how do I do this? How to add this archive at the end? –  Misery Apr 2 '13 at 6:38
    
I've edited my post –  GHugo Apr 2 '13 at 6:48
    
That was the technology in the heyday of Usenet, also known as shar. Check out the GNU sharutils. –  vonbrand Apr 2 '13 at 15:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.