Installers

Features Ptolemy II needs

List of installers

Free Installers

izPack
velocityreviews.com says:
The IzPack native launcher will first check for a JRE on the target system. If one is found, then it will launch the installer. If no JRE can be found, then it will help the user in installing one either from the internet or from a bundled one. To sum-up, the IzPack native launcher will allow your users to install your software even if they don't have a JRE at first sight.
The IzPack native launcher is a .exe file that looks for a file called launcher.ini in the current directory. The launcher.ini specifies: Notes about IzPack Launcher and possible alternatives
launch4j
Can include a JRE, but really only for one application? We need to add multiple apps to the Start Menu.

Commercial installers

Ptolemy installers

To install Ptolemy under Windows, we require an optional custom JRE.

The way we do this is based on Notes about IzPack Launcher and possible alternatives.

  1. We create an izPack installer that installs Ptolemy II
  2. We use launch4j to invoke the izPack installer. The launch4j installer includes an optional JRE.
  1. Create a jre that has JAI, Java 3D, Joystick JMF, JavaComm, X10 etc. in it. See Optional packages not shipped with Ptolemy used at runtime
  2. Copy this jre to $PTII/adm/gen-X.Y/jre

IzPack notes

Things I wish were different

These notes are for IzPack 3.9.0-M1, from September 9, 2006.

Building IzPack

IzPack Developer's page
  1. Download from the trunk
    	    svn co http://svn.berlios.de/svnroot/repos/izpack/izpack-src/trunk
    	  
  2. I followed the Eclipse instructions from the IzPack 3.9.0-M1 release One change was that when setting up the debug, I used
    	    c:\cxh\ptII\adm\gen-6.0\ptII6_0-devel_setup.xml \
    	    -b c:\cxh\ptII\adm\gen-6.0 \
    	    -o c:\cxh\ptII\adm\gen-6.0\ptII6_0-devel_setup.jar \
    	    -h c:\cxh\src\izpack\trunk
    	  
    Where
    c:\cxh\ptII\adm\gen-6.0\ptII6_0-devel_setup.xml
    My IzPack configuration file, usually called install.xml
    -b c:\cxh\ptII\adm\gen-6.0
    The base for my build
    -o c:\cxh\ptII\adm\gen-6.0\ptII6_0-devel_setup.jar
    The file to output
    -h c:\cxh\src\izpack\trunk
    The IzPack source directory.
  3. Problems:
    No valid IzPack home directory found
    Building in Eclipse fails with:
    		-> Fatal error :
    		No valid IzPack home directory found
    		java.lang.IllegalArgumentException: No valid IzPack home directory found
    		at com.izforge.izpack.compiler.CompilerConfig.resolveIzPackHome(CompilerConfig.java:1908)
    		at com.izforge.izpack.compiler.CompilerConfig.main(CompilerConfig.java:1835)
    		at com.izforge.izpack.compiler.Compiler.main(Compiler.java:622)
    	      
    The solution is to copy ShellLink.dll
    		cp c:/Pro*/izpack/bin/native/izpack/ShellLink.dll izpack
    	      
    Uninstaller not found: c:\cxh\src\izpack\trunk\lib\uninstaller.jar
    Building in Eclipse fails with:
    		-> Fatal error :
    		c:\cxh\ptII\adm\gen-6.0\ptII6_0_devel_setup.xml:18: Uninstaller not found: c:\cxh\src\izpack\trunk\lib\uninstaller.jar
    		com.izforge.izpack.compiler.CompilerException: c:\cxh\ptII\adm\gen-6.0\ptII6_0_devel_setup.xml:18: Uninstaller not found: c:\cxh\src\izpack\trunk\lib\uninstaller.jar
    		at com.izforge.izpack.compiler.CompilerConfig.parseError(CompilerConfig.java:1523)
    		at com.izforge.izpack.compiler.CompilerConfig.findIzPackResource(CompilerConfig.java:1488)
    		at com.izforge.izpack.compiler.CompilerConfig.addInfo(CompilerConfig.java:1199)
    		at com.izforge.izpack.compiler.CompilerConfig.executeCompiler(CompilerConfig.java:316)
    		at com.izforge.izpack.compiler.CompilerConfig.main(CompilerConfig.java:1854)
    		at com.izforge.izpack.compiler.Compiler.main(Compiler.java:622)
    	      
    Solution, use ant:
    		cd trunk/src
    		ant dist
    	      
    I'm not sure how to do this from Eclipse. Eclipse can run ant but the setup instructions have us include files from src/lib, not src.
    Problems with the uninstaller
    The Uninstaller was failing for me, see The Unistaller.jar is not working

    I had a problem with OsVersion missing when I ran

    		  java -version uninstaller.jar
    		

    The solution was to check out the 3.9 branch and rebuild:

    		  svn co http://svn.berlios.de/svnroot/repos/izpack/izpack-src/branches/branch-3.9/
    		  cd 3.9.0-M1/src
    		  ant
    		

    I also had to edit build.xml so that we included izpack/util/os/*.class as per The Unistaller.jar is not working

    n

    It turns out that part of the install process updates uninstaller.jar. So, I had to copy the uninstaller.jar file over to the installed version of IzPack - copying uninstaller.jar to the installed application will not do it.

Setting up IzPack to unjar source files

We want to IzPack to unjar the source file because it is faster to create an installer that has one jar file in it than it is to create an installer that has multiple (many thousand) files.

The solution is to use the ProcessPanel and define our own class that does the extraction.

Problems

Cannot find Resource ProcessPanel.Spec.xml for language eng
	    com.izforge.izpack.installer.ResourceNotFoundException: Can not find Resource ProcessPanel.Spec.xml for language eng
	    at com.izforge.izpack.installer.ResourceManager.getLanguageResourceString(ResourceManager.java:137)
	    at com.izforge.izpack.installer.ResourceManager.getInputStream(ResourceManager.java:154)
	    at com.izforge.izpack.installer.ProcessPanelWorker.readSpec(ProcessPanelWorker.java:109)
	    at com.izforge.izpack.installer.ProcessPanelWorker.run(ProcessPanelWorker.java:233)
	    at java.lang.Thread.run(Unknown Source)
	    Error parsing XML specification for processing.
	  
Solution:
Add the following to the configuration file
	    <res src="ProcessPanel.Spec.xml" id="ProcessPanel.Spec.xml"/>
	  
"Cannot find processing class"
The class needs to be present in the jar file that is created by IzPack. We use the -u command:
	    jar -fu c:/Program\ Files/IzPack/lib/installer.jar ExtractJarFile.class 
	  

We also have to update the standalone-compiler.jar file with the new installer.jar file. My solution was to rebuild izPack and run

      cd izpack/trunk/src
      rm ../lib/installer.jar
      ant build.installer
      jar -uf ../lib/installer.jar ExtractJarFile.class
      ant build.standalone-compiler
      cp ../lib/standalone-compiler.jar ../../izpack3.9.0/lib/standalone-compiler.jar
    

However, a better solution is to use <jar src="ExtractJarFile.jar"> in the install.xml file

Error accessing processing class
I modified src/lib/com/izforge/izpack/installer/ProcessPanelWorker.java so that it printed the exception, which was Class com.izforge.izpack.installer.ProcessPanelWorker$ExecutableClass can not access a member of class ExtractJarFile with modifiers "private".
The fix was to change ExtractJarFile so it no longer had a private constructor.

Packaging for the Mac

Between Java 1.6, distributed by Apple, and Java 1.8, distributed by Oracle, the process for creating a Java Mac application changed.

How the Mac apps are created

$PTII/bin/ptinvoke.in is read by $PTII/configure and $PTII/bin/ptinvoke is created. $PTII/bin/makeapp is a symbolic link to ptinvoke. Running make in $PTII/bin invokes makeapp and creates $PTII/bin/Ptiny.app/ and $PTII/bin/Vergil.app/.

Double clicking on Ptiny.app or Vergil.app invokes a binary listed in Info.plist. The binary changed between Java 1.6 and 1.8.

Packaging Java for distribution on the Mac under Java 1.8

In Java 1.8, we used http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/package_for_mac.html, which uses the Application Bundler.

Application Bundler is GPL'd, but Oracle releases it using the Classpath exception. The Application Bundler jar file includes JavaAppLauncher, which gets copied to Contents/MacOS/. That executable processes the Info.plist file. The executable substitutes $APP_ROOT when it is present in the Info.plist file.

The Application Bundler will include a JRE if runtime parameter is set in the build.xml file. We do not set runtime.

The Application Builder wants to copy the jar files into Contents/Java/. Instead, we use $APP_ROOT/../.. to refer to the jar files.

We created a temporary Ant target to create a prototype app directory and then modified the ptinvoke.in file to generate the proper Info.plist file.

Last Updated: $Date: 2014-11-19 09:18:52 -0800 (Wed, 19 Nov 2014) $