Archive for December, 2007

The Binary is the Network

Auto Date Monday, December 3rd, 2007

One of the more enjoyable surprises we encountered making linafy – the Installer generation tool – was its transition from a service to a binary. We had originally envisioned that users would send files to a machine on our site and installers would be created on their respective Windows, Mac OS X, and Linux machines.

The first insight was that we could eliminate the Windows and Mac OS X machines by taking advantage of tools that exist on Linux. To accomplish this, we created installer templates for each operating system that comprised:

  • a Mac OS X Template DMG that contained a Templated Mac OS X pkg file
  • a self-extracting Windows installer template that could be compiled using NSIS

The key to making this work was several small insights – like creating the proprietary .bom file in the preflight script on Mac OS X – and great Open Source programs like NSIS that enable us to make Windows installers on Linux.

Windows Welcome Installer

About halfway through the coding process, it became clear that – if the service only required a Linux machine, then it didn’t need to be a service at all. LINA, after all, can run Linux programs on any operating system. Since the Installer Service was a collection of Linux programs, resources, and kernel modules, that meant that if it was converted into a LINA binary, it would be able to run cross-platform on any operating system.

Linux Installer Progress Bar

And that is how the complex network of Windows, Mac OS X, and Linux machine that defined the LINA installer service became the linafy command that can run on any end-users operating system. Instead of providing access to a network of computers, we can simply send user’s a universal cross-platform Linux binary that can generate installers for any platform.

Mac OS X DMG

What I find so beautiful about this is it’s illustration of the power of the LINA platform. In many ways, LINA Package is the first program written specifically for LINA and it solves problems in a way that are very difficult to accomplish on the JAVA and .NET platforms. In particular, it integrates several resources that normally cannot run cross-platform including:

  • Linux kernel modules to mount the HFS+ DMG partition
  • The NSIS program as a native Linux C program
  • Tools like tar and gunzip that are part of the LINA Package universal binary but invisible to the end user
  • User space in which all of these programs can run and interact.

LINA enabled us to convert our initial requirements from a network of different operating systems to a single binary. The code is in our repository and can be found in the directories src/toolkit/lina-tools/lina-package, templates/installer, and src/libraries.