Best Approach to Writing a Generic Installer for a Linux Application

Best approach to writing a generic installer for a Linux application?

Instead of the installer approach, I think a better way than having a single script that does it at install time is to have a build system which generates .deb or .rpm files suitable for installation on each system you have to support.

A poor man's way of going at that might be to use checkinstall, which creates packages from the files installed via 'make install'. So you'd build your app on each system and have the package magically created in the distro's native format.

What’s the best way to distribute a binary application for Linux?

Having been through this a couple of times with commercial products, I think the very best answer is to use the native installer for each supported platform. Anything else produces an unpleasant experience for the end-user, and in practice you have to test on every platform you want to support anyway, so it's not really a significant burden to maintain packages for each. The idea that you can create a binary that can "just work" on every platform out there, including some you've never even heard of, just really doesn't work all that well.

My recommendation is that you pick a platform or two to support initially (Red Hat and Ubuntu would be my suggestions) and then let user demand drive the creation of additional installation packages. Perhaps make it known that you're willing to support additional platforms, for a modest fee that covers your time and effort in packaging and testing on that platform. If a platform proves to be very different, you may need to charge more for ongoing support.

Oh, and I cannot overemphasize the value of virtual machines for scenarios like this. You need to build VMs for each platform you support, and perhaps multiple VMs per platform to make it easy to test different configurations.

What is the prefered way to publish a binary-only application for multiple Linux distributions?

You should have a look at the Linux Standard Base. It's designed specifically to help people in your position. It defines an environment that 3rd party application developers can rely upon - so there's set version of libc and other libraries, and certain programs and directories live in known places. All of the main Linux distribution support LSB.

That said, you should still probably package the result specifically for each major distribution - just so that your customers can manage your app with their familiar package management tools.

How to make it easy for users to install my software? Does the programming language matter?

I'm surprised ClickOnce hasn't been mentioned yet, Microsoft's own setup project. It's integrated in Visual Studio and checks for prerequisites, like the .Net framework. Be warned though, it does not play too nice if you use certain third-party components (like reporting etc), but you probably won't worry about that at this time :) Oh and it installs EXE's in a weird location, not Program Files :/

Personally I really love Nullsoft's Scriptable Install System! I don't worry too much about the .Net requirement, it comes with Windows Updates and most PC's have it nowadays, but there are NSIS scripts that can check for whatever requirements you need. Just make sure users know it's a requirement, with links to where they can get it if they need; Same for Java.

OT but of interest, have a look at http://smallestdotnet.com

Best Practices in creating software appliances?

There are several things you need to consider when creating an appliance. The one thing you don't want to be in the business of is maintaining the OS. So pick an OS that is considered stable and secure. When installing the OS, only include those packages absolutely required for your application. Always pick stable versions of any application frameworks. Ideally you'll use something that is relatively mainstream. Once again, you should be supporting your application, not the framework.

A non-exhaustive list would include things like:

  • Picking a stable, supported, secure OS.
  • Choosing commodity, off the shelf hardware. Parts should be easy to find and replace.
  • Don't install unused packages.
  • Figure out how you'll patch / update your software once deployed.
  • Provide a Web-base configuration option so you don't have to log into the shell to change settings.
  • Make log files available via a web front end for the same reason as above.
  • bootstrap your application during start up.
  • Determine how you'll secure your web front end and the appliance in general.
  • Provide a way to migrate your application to another appliance in case of general hardware failure.
  • Does your app merit clustering and failover?
  • Make backing up your application easy and pain free. Ideally your users won't have to shutdown the app to backup their data.

JavaFX Native package for linux

I think I found solution although it still needs some tweaks. When eclipse generated rpm is installed, we can use rpm build tools. Just download and use rpmrebuild -e packagename command in terminal. It is possible to change %attr for each file/folder. After edit, new rpm file is created (somehow smaller, maybe better compression?) and can be distributed further.

Still don't know how to change root ownership to the user who installs, but for now it's definitely progress.



Related Topics



Leave a reply



Submit