Jump to: navigation, search

Installer SFX creation

This document describes creation of self-extracting installations, based on EPP(http://www.eclipse.org/epp/).

The creation requires three elements: compiler, linker and native launcher. All of them can be retrieved from CVS repository at dev.eclipse.org (module /cvsroot/technology/org.eclipse.epp/plugins/org.eclipse.epp.sfx.tools)

In short, process consist of the stages below.

Preparing Content

Create temporary folder, for example "c:\Temp". Put into the folder desired data. For example, if we want create an Eclipse installation, we must put Eclipse itself and installer. Lets take that they are "eclipse" and "installer" folders respectively. So, our temporary folder consists of this elements: "c:\Temp\eclipse" and "c:\Temp\installer"
NOTE: Temporary folder itself will not be included in resulting archive, i.e. files and directories will be stored in relative path. In our case archive will contain folders "eclipse" and "installer".

Compilation

Compiler is an Java console application with main class name "org.eclipse.epp.sfx.builder.XSECompiler". It requires at least 5 arguments (It prints help if executed with lesser number of arguments):

Arguments

  1. Path to archive content folder.
  2. Type of autorun application (application what will be executed after extraction of required files): native("native" argument), Java console application("jconsole" argument) , Java windowed application("jwindow" argument).
  3. Path to autorun.
  4. Arguments to be passed to autorun. Note, that string "$#launcher#" (without quotes) will be replaced by launcher with it's full name.
  5. Path to resulting archive file. Please note, that if file already exists it'll be overwritten without prompt.
  6. List of files what must be extracted by launcher prior to execution of autorun.

NOTE: When native launcher executed it will extract only files, which names were passed in 6..N arguments.
NOTE: Make sure that you don't forget to put path to installer autorun file in that list.
HOWEVER: If you don't sure what files are required to be extracted before executing installer, simply don't pass any arguments. That is signal to compiler, that ALL content of folder, which path is given in 1st argument are required to be extracted. So if we wanted extraction of all files, arguments for XSECompiler would be like this:

C:\Temp native C:\Temp\install\eclipse.exe "-vmargs -Dinstaller.jar.path=$#launcher#" C:\eclipse-archive.sfx

NOTE: If you don't need to pass any arguments to installer, you still must pass an stub. In our example it would be:

C:\Temp native C:\Temp\install\eclipse.exe "" C:\eclipse-archive.sfx

Empty quoted string is a signal to compiler, that no arguments required by autorun executable.
In our example, we want all contents of installer folder only to be extracted before autorun started, so we pass this arguments(line brakes added for readability, omit them if you want copy-paste arguments):

C:\Temp native C:\Temp\install\eclipse.exe "-vmargs -Dinstaller.jar.path=$#launcher#" C:\eclipse-archive.sfx
C:\Temp\install\configuration\config.ini
C:\Temp\install\.eclipseproduct
C:\Temp\install\eclipse.exe
C:\Temp\install\plugins\org.eclipse.core.commands_3.3.0.I20070502-1300a.jar
C:\Temp\install\plugins\org.eclipse.core.contenttype_3.2.100.v20070319.jar
C:\Temp\install\plugins\org.eclipse.core.jobs_3.3.0.v20070423.jar
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502.jar
C:\Temp\install\plugins\org.eclipse.core.runtime_3.3.100.v20070409.jar
C:\Temp\install\plugins\org.eclipse.epp.installer.core.win32_0.5.0.jar
C:\Temp\install\plugins\org.eclipse.epp.installer.core_0.5.0.jar
C:\Temp\install\plugins\org.eclipse.epp.installer.europa_0.5.0.jar
C:\Temp\install\plugins\org.eclipse.epp.installer.ui_0.5.0.jar
C:\Temp\install\plugins\org.eclipse.epp.sfx.archive_0.5.0.jar
C:\Temp\install\plugins\org.eclipse.equinox.app_1.0.0.v20070423.jar
C:\Temp\install\plugins\org.eclipse.equinox.common_3.3.0.v20070426.jar
C:\Temp\install\plugins\org.eclipse.equinox.launcher_1.0.0.v20070502.jar
C:\Temp\install\plugins\org.eclipse.equinox.preferences_3.2.100.v20070409.jar
C:\Temp\install\plugins\org.eclipse.equinox.registry_3.3.0.v20070416.jar
C:\Temp\install\plugins\org.eclipse.jface_3.3.0.I20070503-0010.jar
C:\Temp\install\plugins\org.eclipse.osgi_3.3.0.v20070430.jar
C:\Temp\install\plugins\org.eclipse.swt.win32.win32.x86_3.3.0.v3339.jar
C:\Temp\install\plugins\org.eclipse.swt_3.3.0.v3339b.jar
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\META-INF\eclipse.inf
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\META-INF\MANIFEST.MF
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\META-INF\ECLIPSE.RSA
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\META-INF\ECLIPSE.SF
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\about.html
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\runtime_registry_compatibility.jar
C:\Temp\install\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.100.v20070316\fragment.properties
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\META-INF\eclipse.inf
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\META-INF\MANIFEST.MF
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\META-INF\ECLIPSE.RSA
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\META-INF\ECLIPSE.SF
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\eclipse_1013.dll
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\about.html
C:\Temp\install\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.0.v20070426\launcher.win32.win32.x86.properties

Linking

For this we need launcher, it's "/org.eclipse.epp.sfx.tools/templates/win32.x86/extractor.exe" file. To link archive with launcher we must provide following arguments to the linker (it's Java console application, main class name is "org.eclipse.epp.sfx.builder.XSELinker"):

file "D:\EPP workspace\org.eclipse.epp.sfx.tools\templates\win32.x86\extractor.exe" c:\eclipse-archive.sfx c:\install.exe

Where:

  1. argument, "file", reserved for future use. Currently must be "file" (in future it will be support for "msi", "deb", "rpm" etc)
  2. argument, ""D:\EPP workspace\org.eclipse.epp.sfx.tools\templates\win32.x86\extractor.exe"", is a path to native launcher.
  3. argument, "c:\eclipse-archive.sfx", is a path to archive file, produced by XSECompiler.
  4. argument, "c:\install.exe", is a full name for resulting self extracting installation.

Done, we have an Eclipse installation for Windows :)