views:

253

answers:

6

On windows applications are typically packaged as MSI, on Redhat Linux as RPM, what would be a best open source packaging method that could be used to deploy applications to all platforms including different flavors of unix and windows?

Contents would include exes, unix binaries, java jar files, user data, even database scripts to be run.

(I recognize contents would vary per destination OS, ie. binaries would be different, win exe vs unix binary etc, but for example config files may be the same or in the case of java even the bytecode jars)

Key feature I'd like the packaging to support is different users and permissions for different directories, however I recognize supporting this feature multiplatform may be very difficult.

+4  A: 

Rather than build a package that is supposed to work across all of your platforms, which is likely impossible, you should have your build system build different packages for each target platform.

RibaldEddie
If this truly is impossible, I will have to follow the approach you recommend. But I am still hoping for 1 solution fits all as well.
Ville M
I am probably wrong that it is impossible, but I think that best practices probably suggest you build platform-specific packages.
RibaldEddie
I concur with RibaldEddie. Installing software is, in my opinion, a system operation. Using prevailing methods on the particular system seems like the best way to go if you want to provide the least surprise to the customer or admin.
Craig S
+1  A: 

NSIS is an open-source solution which, as far as I know is able to build installers that run on Windows and UNIX-likes alike. However, for software deployment on Windows (especially in corporate environments) MSI is the way to go and NSIS is more of a headache.

So I wouldn't advise that you try to build a single package/installer for different platforms. But rather, as RibaldEddie indicated, multiple packages: one for each platform. That also allows to restrict the contents of the package to the files relevant to each platform.

Joey
+1  A: 

I have a client that uses IzPack to create a single installer (it's Java-based) that installs their app on Windows, OS X and Linux.

http://izpack.org/

Paul Lefebvre
This looks very good, but expensive. Anything like this but free?
Ville M
I have no idea. I had never heard of IzPack until just last month. I always create separate installers for each platform.
Paul Lefebvre
Expensive? It's licenced Apache 2.0 :-?
rq
A: 

If you'd like to support packaging for multiple distributions, I'd suggest helping the packagers for those distributions out; use some sort of well-known build system for your software (GNU's autotools or something like scons or waf), and document the build, optional dependencies, and so forth pretty well.

That way, when a Debian, Ubuntu, Red Hat, SuSE, whatever, packager comes along, they'll be able to create the package for you. You can optionally include packaging templates for one or more distributions in a separate VCS tree that is available, if you'd like.

If you are looking at packaging a closed-source/proprietary application for multiple systems, you'd probably do best to package up a .tar.gz file and document the installation process for it. You'll also want to make sure that the build process used doesn't embed any path information into the application, so that it can be run in /opt, /usr, or /usr/local, which are some popular choices for third-party add-on software.

Michael Trausch
+2  A: 

With CPack (It come with CMake) you can create packages for Windows (with NSIS), Linux (rpm and deb), and OS X with "make package". CMake also simplify cross-platform building.

For a sample you can look at avogadro's CMakeLists.txt and AvoCPack.cmake

brunoqc
A: 

BitRock InstallBuilder allows you to create installer packages for each one of the platforms you mentioned (as well as creating RPM, DEB, packages etc. from a single project file)

Daniel Lopez