Skip to content

Titanium Installation

jhaynie edited this page Sep 13, 2010 · 30 revisions

These are some design notes for installation of the titanium SDK and titanium apps:

General Design

Need to be able to support 2 types of applications:

  1. Installation executable that contains everything you need to run the application including SDK, etc.
  2. Application archive that contains only the application specific files and requires the Titanium SDK to be installed

Titanium will support the following different package creation modes:

  1. Auto-create application installer which includes runtime and application archive
  2. Auto-create standalone installer and standalone application
  3. Create standalone application (which requires no runtime to be installed)
  4. Create application archive

Application installation can be initiated in several different ways:

  1. Application is bundled in its own installer by the developer. This can either be by (a) bundling the full executable or (b) building the Titanium SDK and the application archive.
  2. Application is auto-installed using a “badge installer” from a web page

The Titanium Application Archive will have the following special properties:

  1. Mimetype: application/vnd.appcelerator-titanium-app-package+zip
  2. File extension: TIA (titanium archive or titanium application)

(NOTE: I checked the File extension registry and this is not used by any known application)

The application archive will be a zip file which will contain the following file and folder structure:

  1. META-INF
  2. assets
  3. application

The META-INF folder will contain 2 files:

  1. application.xml – the application manifest file
  2. signatures.xml – the application security information for the code signing of the application

The assets folder will contain files used by the application installer during setup/installation:

  1. logo_16.png – 16×16 icon
  2. logo_32.png – 32×32 icon
  3. logo_48.png – 48×48 icon
  4. logo_128.png – 128×128 icon

The application folder will contain all the assets used by the application as its root directory.

Application Installation from SDK

Assuming the OS has the Titanium SDK installed, the SDK will attempt to open the application archive doing the following:

  1. download the application archive
  2. check the code signing credentials
  3. extract the zip into a temporary directory
  4. read the application descriptor to build the installation dialog
  5. show the user the application dialog, using the application descriptor to customize. example dialog from AIR:
  6. if the user approves the installation, create the desktop icon, tray icon and application and any related files, icons, etc. as appropriate for the OS into the application folder, etc.
  7. the installer will open the application

NOTE: can we make the installation be an actual titanium application itself and just do the extraction, code verification and then pass on the command line the info to the installer titanium app. The advantage is that the dialogs and code could be done in HTML/Javascript. We could use the Desktop and Filesystem API to write the file, etc.

NOTE: all dialogs will need to be localizable.

Win32

On windows, we’ll need to associate the file extension with the shell open command so that windows knows to run our SDK installer to install the app. Here is sample code example: http://www.codeproject.com/KB/shell/cgfiletype.aspx

OSX

On OSX, we’ll need to set the CFBundleTypeExtensions and CFBundleTypeMIMETypes in the Info.plist.

Information of UTIs: http://developer.apple.com/macosx/uniformtypeidentifiers.html

Browser Auto-Install

The end-user application will use a “badge installer” to support auto-installation of the application. The badge installer will be a stub Flash SWF and will do the following:

  1. check to see if the SDK was already installed (for future, we should support minimum version of the SDK so we can check if the version criteria is met and auto-update to SDK before installation)
  2. if the SDK isn’t installed, the SDK will be downloaded and executed before continuing
  3. once the SDK is installed, the installer will download the application archive
  4. the installer will open the application (thus causing the SDK to install the application)

(NOTE: it appears Adobe Flash 9+ has special Adobe AIR provisions that we don’t have access to).

Install of SDK

Install screens from Adobe AIR:

License Screen (initial)

This is the initial screen that is displayed when you double click the installer (from OSX).

Installation Progress

Installation progress…

Install Complete

This is the screen that is displayed during install.

uninstall

The screen above is the warning if apps are installed that depend on AIR.

This is the screen during uninstallation. No confirmation is shown upon completion.

Adobe AIR install

On OSX, the size of the installer for 1.5 is 58.4MB.

Install scenarios

  1. Everything bundled in one
  2. Application bundle bootstrap – the app + network boot/install
  3. Bundle only (files + manifest) – requires runtime
  4. Hybrid #1 – no runtime, some/all modules
  5. Hybrid #2 – no runtime, only non-runtime modules

Packaging

Win32

For windows, the boot.exe is packaged as a self-extracting archive and repurposed for a number of use cases.

The self-extracting executable is created by combining both the boot.exe and the application bundle into one file. The application bundle must be in zip format. The executable is created by appending the zip to the boot.exe (created a number file). You must use binary copy for this to work.

When the boot starts, it will attempt to see if there is a piggybacked zip file attached to it. This works because the zipfile format reads from the end of the file and executables are read from the beginning.

The bundle will take the same format as a normal distribution. The following files/folders are required:

  1. manifest – the application manifest
  2. resources – the application resources folder
  3. tiapp.xml – the titanium application descriptor XML

The following folders are optional:

  1. modules – the bundled modules to use (each module should be unzipped inside a folder with the module name)
  2. runtime – the bundled runtime to use – in this case, the runtime will be used instead of searching for a common runtime
  3. installer – the runtime module installer (named dependant on OS – win32 is Installer.exe)

If any of the components in the module are missing or version specification not met, the boot will attempt to find the installer inside the binary (NOTE: we should also look in the shared runtime too) for the installer folder. If this folder is found, it will launch the installer and pass it a list of component/versions that need to be retrieved from the network.

The boot will check for a special file named “.installed” to determine if the application installer needs to be invoked to install the application for the first time. After installation to the destination directory, an empty file in the destination directory will be created for subsequent boots to let the boot know that the install is completed and to skip the app install step. In the case the developer wants to perform their own installation or have a self-launching executable, this file can be pre-created and placed into the application zip.

Clone this wiki locally