开发者

Creating an installer for Linux application [closed]

Closed. This question 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.

Closed 8 years ago.

开发者_JS百科 Improve this question

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.


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.

Learning resources


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:

  1. Using autoconf,
  2. Using CMake,
  3. Using a Java installer like IZPack
  4. etc


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜