0

I am looking for a way to create download-and-install style programs for Linux. To clarity what I mean by "download & install", I mean that the installation process proceeds like this:

  1. User downloads graphical installer (NOT a deb, rpm, etc. file... I'm talking about an actual ELF executable) from website
  2. User runs graphical installer (preferably by double-clicking it) as a regular user (not as root) - installer puts program & its dependencies (included with the installer) in a nice place in the home directory and adds things to the desktop environment menus to make running easier
  3. User can now run the program from the desktop environment menus
  4. Uninstaller is installed alongside the program, which can be run at any time

This style of download & install is very similar to the method the majority of traditional personal computer users (in contrast to mobile PC users which are accustomed to app-stores) are used to and I wish to distribute any programs I make using such a method.Plus I just really like this method of software distribution. It just feels right.

I predominantly use C++ and FLTK for Linux programs.

I am interested in all of the different options available for replicating this experience, so feel free to mention different methods of "getting there"

Assume that a program has already been created and that it needs to be "retro-fitted" into this installation style

  • So.. ./configure; make dep; make; make local-install? – DopeGhoti Feb 06 '18 at 18:36
  • I want to distribute pre-compiled binaries though source code would be available – Uncreative Name Feb 06 '18 at 18:39
  • 3
    See https://unix.stackexchange.com/questions/420513/will-a-linux-executable-compiled-on-one-flavor-of-linux-run-on-a-different-one/420518#420518 - copying precompiled binaries is an iffy proposition at best unless you're absolutely certain that you're bringing all the dependencies along for the ride and you're dropping them on a compatible architecture. And don't even get me started on integrating your self-packaged tool with any user's given GUI configuration. GNOME and KDE are hardly the only games in town, and some users might take umbrage with your installer monkeying with their configs. – DopeGhoti Feb 06 '18 at 18:45
  • Doable. Look at the ".run" files that Enemy Territory, Unreal Tournament, etc used to install - tar file appended to a shell script basically. Of course, I would much prefer a native package version so my package manager takes care of dependencies, upgrades, uninstalling, etc. – ivanivan Feb 06 '18 at 18:51
  • 2
    Funny... It just feels right It actually doesn't, it just feels "familiar" (to old timers). The "majority of traditional personal computer users", an endangered species, BTW, will be moving to the App Store model way sooner than you think. Why, you may ask? Because Microsoft said so. –  Feb 06 '18 at 18:51
  • Those selfsame .run files (and thank you for reminding me about the fantastic ET) do what my earlier comment mentions- the devs do a meticulous job ensuring all dependencies are present, and they were often precompiled for i386 or i686 for the purposes of portability, and in come cases still game with a README or INSTALL file outlining all the outlying dependencies that need to be addressed before executing them. – DopeGhoti Feb 06 '18 at 18:55
  • 1
    New linux users who are more used to Windows may appreciate this, or they may just get confused because your program requires a different installation method to all other software on their system. All other linux users will hate it and hate your software by association. It would be better to compile packages for each of the distros you wish to support. or work with the distribution maintainers to help them package your software. – cas Feb 07 '18 at 02:08
  • Please note that this question was not asked out of disdain for Linux. I love Linux! I just think centralized software repositories are a Bad Thing. :) – Uncreative Name Feb 09 '18 at 19:28
  • And you're right, I would probably end up making a small subset of Windows converts really happy and a very large majority of Linux natives very upset. It's just not worth it to follow this method rigidly. Snapcraft and Flatpak are interesting technologies, however. – Uncreative Name Feb 09 '18 at 19:34

1 Answers1

1

The most common installation tool of the type you’re after, used nowadays on Linux, is MojoSetup. Many, many games use this, and I’ve come across it used for general-purpose applications as well. As others have mentioned, you’ll need to take care with any libraries you need; many games provide a dynamically-linked binary along with all their dependencies, along with a statically-linked binary.

Another approach, perhaps more future-proof, is to use Flatpak; that will take care of most of the dependency and runtime issues you’re likely to come across.

As far as desktop integration goes, the safest option is to drop a well-formed .desktop file in the appropriate place; most users’ environments will pick those up. Other users will be used to adding a launcher wherever they want to; don’t try doing it for them...

Stephen Kitt
  • 434,908
  • Flatpak certainly looks interesting. MojoSetup looks very crusty and outdated, but IDRK what I expected coming up into a Unix Q/A site asking about how to replicate a non-Unix method. When I develop for Linux I am probably going to go for Flatpak because as you said, it is much more future-proof than the method I was describing. Thank you! :) – Uncreative Name Feb 09 '18 at 19:31