Creating a Native Installer for a New Platform
Currently, you can create native installers for Windows, Linux Intel,
Mac OS X, and Solaris Sparc with the JExpress license. If you want native
installers for other platforms, then you simply need to purchase licenses
for JExpress and JExpress Custom Native.
The JExpress Custom Native license includes the C++ source
code to 2 small programs: C Installer and Unzip. Both programs are very likely
to compile, without any changes, if you use a GNU C++ compiler that is
configured for POSIX compatibility. Not all versions of all compilers work
with JExpress. Here are the earliest versions of the compilers
that we use for the standard platforms:
|Mac OS X
||gcc 3.3 20030304
||gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
- Install JExpress Custom Native in your C++ development
- Add a new subdirectory under the platforms
subdirectory of your JExpress subdirectory. The new subdirectory should
be named with the target system's name (e.g., HPUX, AIX).
- For each native platform,
- Create the following binary files in this order:
- Prepare a properties list for the
- Test the new native installer
UnzipSfx and UnzipX
DeNova modified the freely distributable unzipsfx so it can
automatically launch another program after it expands the files an the
- Move to the installation's subdirectory called
- Copy the file Makefile from the
unix subdirectory to the unzip
If there isn't a Makefile in the unix
subdirectory, then issue the command mv unix/makefile
- Review the Makefile to see which configuration fits
your target system.
- Make sure your compiler is configured to use POSIX. If it's not, then
be sure to use the -DPOSIX command line switch
- Issue the following command: Makefile [command]
where [command] is the command name for your target machine. If you
didn't see your specific target machine listed in the makefile, then you
can probably use generic2. For example, if you're creating a native
installer for a generic Unix system, then you'd type: Makefile
- As soon as the makefile is successful, you'll have 2 new programs:
unzipsfx and unzipx.
- You can test these programs by using the testmake.zip file included
in the unzip subdirectory
- Issue the following commands to test unzipx:
cp ../unzipx .
cp ../testmake.zip .
cat unzipx testmake.zip >test
chmod 777 test
- If everything works properly, then there will be 2 extra files in the
- You can follow the same steps to test unzipsfx, but then the 2 files
will be expanded in a temporary directory on your system.
- Move unzipsfx into the new subdirectory you created
under JExpress's platforms subdirectory.
Self Extracting JRE
You must create a self extracting archive of the freely distributable
JRE. After you obtain the JRE, use the following procedures to create the
self extracting archive.
- Move to the subdirectory with the JRE. This is the directory which
includes the bin and lib subdirectories
for the JRE.
- Zip all the files, retaining the directory tree. Under usually, the
command is probably:
zip -r jre[targetCode] *
- Copy the file unzipx from the
unzip subdirectory that you created earlier.
- Issue the following command:
cat unzipx jre[targetCode].zip >jre[targetCode]
- You can test the jre[targetCode] file by
issuing the following commands:
cp jre[targetCode] [testDir] cd [testDir] chmod 0744 jre[targetCode]
where [testDir] is a test directory you created for the purpose.
- You can verify the file expanded properly, if the [testDir] contains
the same files and directory structure as the original JRE directory
- Move the jre[targetCode] file into the
new subdirectory you created under JExpress's
The C Installer has the following primary functions:
- locate any existing JREs on the target system
- verify the detected JRE is the correct version
- install the JRE if it doesn't find the correct one
- launch the Java installer
To create the C Installer:
- Move to the cinstaller subdirectory
- Copy the makefile file from the unix subdirectory to
the cinstaller directory
- Issue the command: make
- As soon as the makefile is successful, you'll have a new program
- Move the install file into the new subdirectory you
created under JExpress's platforms
Prepare a Properties List for the platform
Use a standard text editor to create a properties list file, called
platforms.properties, in the new subdirectory you created under
JExpress's platforms subdirectory. The file must
contain the following key pairs. If you're creating a native installer for
a Unix platform, then you probably just want to copy the sample platforms.properties.
||Name of the program that creates a self extracting archive
||List of extra filenames to be included in native
||Filename of the self extracting archive for the JVM
||Type of JVM installed, i.e., JRE, JDK
||Command to start the JVM
||Version of the JVM in the self extracting archive
||Required version of the JVM to operate your app, strongly
recommend at least 1.5
||Extra parameters used on the JVM's command line
||Filename for target platform's native installer
||Classpath for the installer
||System security filename
||System security filename
||Main classname for installer
||Command line switch for the JVM to set the classpath
||Command line switches used for the installer
For details on all the properties that a JExpress installer supports,
You do not want to include any other properties in the
platform.properties file, then those listed below and also listed in the
InstallPropertyNames that are related to the native installer.
#Mon Jan 18 10:42:19 CDT 2006
Testing A New Native Installer
Testing with JExpress
The most reliable way to test your new native installer is with JExpress.
First, make sure the following files are in the new subdirectory you
created under the platforms
Next, start JExpress and load your project. Check the native installer box on the
Build panel. Copy the file from
the subdirectory under the build directory's to your target
There is an alternative method that we do not
and we will not
support. Nonetheless, if you've had to
change any of the source files, then it might be easier to test using
this Q&D method. Plus, we use our docs to help remind our own
engineers how to perform these procedures. :)
- Create a test directory
- Copy the following files to the directory: install,
install.jar, and jex.control to the test subdirectory.
- Copy the install.jar and
jex.control file from the cinstaller
- In the jex.control file, modify the value for the
jvmSelfExtractor to match the new
extracting archive for the JRE.
- Zip all the files in the test directory into a file called
jinstall.zip. Under Unix, the command is probably: zip jinstall
- Copy the unzipsfx file to the test
- Issue the following commands:
cat unzipsfx jinstall.zip >jinstall
chmod 0744 jinstall
- If all goes well, your application's installer will start up
- If you get an error during compilation that reports a comma is
missing or that a command ends too soon, then strip the makefile of all
- If you get an error from one of the unzip C files that reports a
character is unrecognized, then strip the C file of all carriage
- The makefile under the unix subdirectory must be
upper/lower case (i.e., Makefile).
jre[targetCode] is a 3-5 character representation of
the target system. For example, for a Linux system, we've named the self
extracting archive jrelnx and on a Windows system, jrewin.