How to make linux installer

How to make Linux application (all in one fille) installer?

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

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.

6 Answers 6

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

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

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.

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.

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

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.

Источник

A custom Linux installer

Is it possible to create a custom linux installer which allows me to choose a very minimal installation which bascially includes a kernel, bootloader, basic networking/core utlities, shell and some of my own C++/Java cooked applications. I am setting up a small cluster using a couple of old computers. I may have to often delete/re-create partitions and modify my application settings to match my requirements. I tried both Ubuntu and Fedora and even went as far as using their remastering tools. The problem is they end-up installing packages unnecessary for my work and worse they actually startup during boot. Currently, I have scripts which will have to be downloaded to these machines to do the ‘clean-up’ work. I even had a look at LFS (Linux from Scratch). It was just the thing I needed, but it had no associated installer with it. Tools for automating LFS installation like nALFS and jhalfs do not have good documentation and are unsitable for this kind of work. It would be really good if I can make an installer iso file which will do everything in the first go itself, i.e. while installing linux. Is it possible to create such a linux installer? Are there any such ready-made tools?

Читайте также:  Ssh windows to linux with key

5 Answers 5

I’m a big fan of ArchLinux, a clean and flexible linux distribution.

The installer only installs the basics (no X, just a root prompt) and allows you to customize from there.
pacman -Sy bash-completion openssh

It currently 7th on DistroWatch, the highest ranking «non user friendly» linux.

  • Very up to date (Rolling release)
  • Great package manager (pacman)
  • Lightweight and (technically) simple
  • Configuration by editing text files (not for linux newbies)
  • Easy to create your own packages.

For your setup I recommend creating an system image with CloneZilla or an other partition clone/restore tool.

After the restore you’ll just have to change the hostname to use an unique one like «node21» or something.

Setup an your own custom repository with your applications.

To update the nodes you can publish the new version of your package and use Archlinux’s package manager to update the nodes.

This way you can use an «old» image and easily bring it up to date. Bypassing the whole custom installer problem.

Источник

How to create a self-extracting archive or installer in Linux

While a typical archive file relies on a separate program (e.g., tar , gunzip , 7z ) to extract content from the archive file, a self-extracting (SFX) archive is an executable itself, and can self-extract its content simply upon running. A self-extracting installer does the same thing, but it also copies the extracted content to appropriate directories.

In this tutorial, I will explain how to create a self-extracting archive or installer on Linux.

For this purpose, you can use a command-line utility called makeself . The makeself tool is a shell script which creates a compressed TAR archive out of input directories/files, and adds a small shell script stub at the beginning of the archive to initiate self-extraction, and guide installation of extracted files.

Install makeself on Linux

To install makeself , download the latest version in an archive format, and extract the downloaded archive as follows. Once the archive has extracted itself, it will create a new directory called makeself-2.4.2. Copy all the shell scripts in the directory to /usr/bin .

$ wget https://github.com/megastep/makeself/releases/download/release-2.4.2/makeself-2.4.2.run $ chmod 755 makeself-2.4.2.run $ ./makeself-2.4.2.run $ cd makeself-2.4.2 $ sudo cp *.sh /usr/bin

The basic usage of makeself.sh is as follows.

makeself.sh [options] [directory_to_package] [sfx_archive_filename] [label] [startup_script] [optional_script_args]

The label argument is the message to print while an SFX archive is uncompressed.

Читайте также:  Изменение имя компьютера astra linux

The startup_script argument specifies the script/command to launch after an SFX archive is successfully extracted. This is useful when you create a self-extracting installer. Typically a start-up script will copy/install the extracted content to appropriate target directories. The start-up script must be located inside the directory to package, so that the script is included in the SFX archive.

Here are some of available options for makeself.sh :

  • —gzip : Use gzip for compression (default option).
  • —bzip2 : Use bzip2 for compression.
  • —nocomp : Do not compress.
  • —notemp : Do not extract files into a temporary directory, but in a new sub-directory created in the current directory.
  • —follow : Follow all symbolic links, and archive files that are symbolic-linked.

Create a Self-Extracting Archive

To create a self-extracting archive which contains all files inside ./backup directory, do the following. Here the start-up routine does nothing more than printing Extraction done .

$ makeself.sh --notemp ./backup ./backup.run "SFX archive for backup" echo "Extraction done"
Header is 403 lines long About to compress 1540 KB of data. Adding files to archive named "./backup.run". ./ ./jpeg/ ./jpeg/1.jpg . . CRC: 2238411397 MD5: 0b0fd3a2ba08ffcec821b9cbaa11b70d Self-extractible archive "./backup.run" successfully created.

To extract files from the archive, simply execute the archive:

Creating directory backup Verifying archive integrity. All good. Uncompressing SFX archive for backup. Done

Create a Self-Extracting Installer

If you want to create a self-extracting installer, you need to prepare a separate start-up script which will do the installation upon file extraction. Here I assume that the program directory to package is located at ./program . So prepare a start-up script inside ./program directory.

#!/bin/sh if [ -d $HOME/bin ] then cp myprogram $HOME/bin/ fi

Then make the start-up script executable.

$ chmod 755 ./program/install.sh

Go ahead and create a self-extracting installer, and package the start-up script along with it as follows.

$ makeself.sh ./program ./program.run "SFX installer for program" ./install.sh

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Источник

Creating an installer for Linux application [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

I’m developing a small cross-platform application and I need some advice on how to install it in Linux. I am using InnoSetup in Windows and an application bundle in OSX but I have no idea how to get my app installed in Linux, are there any opensource installer creators for Linux? Thanks.

5 Answers 5

The standard all mighty universally available installer on *nix systems (and not only) is Autotools.

# the user will install like so: ./configure --with-stuff make # if package is from source make install 

You can also provide distribution specific installers like a RPM on RedHat or CentOS or deb for Debian, Ubuntu, although once you have the Makefile spitted by Autotools, making these is a breeze.

# the user will install like so: yum install your-package-1.0.rpm # on redhat or apt-get install your-package-1.0.deb # on debian 

Autotools also known as «the GNU build system» is a little scary on the first sight, and the new user is puzzled when meeting things like the ancient m4 macro system & co. but nota bene this is the way most people do it and is pretty easy once you get the hang of it.

Читайте также:  Kali linux настройка принтера

Just write a clean autotools setup, and let the distribution folks figure out the rest for their needs for the time being.

+1 for autotools; it just takes a little bit of expertise to use autotools. Here’s a link: lrde.epita.fr/~adl/dl/autotools.pdf

Thanks for the details. I was under the impression that I would have to distribute source with autotools which is not something I want to do but I’ll have a read of the PDF. Thanks

If possible, opt for not requiring an installer but using a simple extract-and-run approach. This will allow the user to put the file(s) anywhere they want and run it.

But, you do have other options, such as:

Take a look at InstallJammer. You can write a single project for both your Windows and your Linux installer, and the Mac support is coming very soon.

Unfortunately the project has been discontinued Active development of InstallJammer has been discontinued. The source is available for all versions and will always remain so, but your efforts might be better spent on an installer that is active in its development.

Write a really robust makefile! or use CMake

I started writing unistall for situations when you had to install binary packages on a variety of distros.

It attempts to do a few things:

  • Realize the OS type and package manager, allowing you to use the system package manager to pull in any dependencies that your program might require. For instance, it will know to use apt-get install libncurses5-dev if using debian/ubuntu, yum install libncurses-devel if using RHEL/Fedora/CentOS
  • Understand what mechanism is used to update init, if needed
  • Create a safe un-installer
  • Work on any shell (bash, dash, zsh, pdksh, busybox ash, etc)

I leave the repo up because its full of useful bits, however I quickly gave up on the idea of an install sheild type program for Linux distributions. You’ll find that its much, much better to produce installable packages for .deb , .rpm and (possibly) slackware .tgz formats.

This can be integrated into your build system using a tool like checkinstall. Note, the packages that checkinstall generates are not always perfect, according to strict lint guidelines set out by Debian and others, however the packages work just fine.

The best installation experience you can provide a user is allowing them to install (and update) your software using their native package manager.

Источник

Оцените статью
Adblock
detector