FeaturesPluginsDocs & SupportCommunityPartners

NetBeans IDE Installer

Author: Marek Slama, Sun Microsystems/NetBeans

Abstract:
This document describes installers distributed for NetBeans release 4.2.

Document History:
04/29/2005 : 0.1 : First preliminary version of the document
Contents:

1 Introduction

NetBeans IDE Installer installs NetBeans IDE. During installation uninstaller is created to uninstall product.

Installer supports following platforms:

  • Solaris on Sparc platform
  • Solaris on X86 platform
  • Microsoft Windows
  • Linux
Mac OSX is exception as we do not provide standard multiplatform installer as for other platforms but gzipped tarball distribution. It contains Mac application structure which is recognized by Finder so that Mac users can see application icon in Finder and can run IDE by double clicking on IDE app icon in Finder. Uninstaller is not supported on Mac OS X. User can remove NetBeans IDE by moving app dir to Trash.

Exact version of OS/hardware on which installer is supported/tested depends on NetBeans IDE system requirements. Exact list of tested platforms is provided by QA.

Installers/uninstallers run only in GUI (Swing mode). Silent or console modes are not supported. The only exception is NetBeans IDE tar/gnuzip distribution for Mac OS X. On Solaris/Linux Metal L&F is used. On Windows native L&F is used.


2 CVS project structure

Installer is in O/S CVS as subcomponent 'coreide' of CVS module 'installer'. It depends on subcomponent 'lib'. It is free form NetBeans IDE project. Directory /cvs/installer/coreide contains following files/directories:

  • build directory is created when installers are built. It contains temporary files, class files, ...
  • build.properties file contains IDE project properties.
  • build.xml is ant build script.
  • coreide.xml is InstallShield project XML file.
  • dist directory is created when installers are built. It contains installers.
  • nbproject directory contains IDE project files.
  • ProgrammingNotes.txt contains description of ant build script, build targets, properties.
  • resources directory contains resource files for installer like license files.
  • src directory contains Java sources of installer.
  • unix.xsl, win32.xsl XSLT stylesheet used to modify some InstallShield project properties according to target platform.


3 Building installer

NetBeans IDE installer is based on InstallShield MP 5 SP3. Following prerequisites must be fulfilled to build installer:

  • Linux or Solaris OS
  • InstallShield MP 5 SP3
  • Apache Ant 1.6.2
  • JDK 1.4.2_X
Following build targets are provided in build.xml:
  • 'build' build English installers for 4 supported platforms
  • 'build-ml' build ML (English - en, Japanese - ja, Simplified Chinese -zh) installers for 4 supported platforms
  • 'clean' delete build and clean directory and also call clean for shared library at ../lib
Build script uses NetBeans IDE uncompressed build, storage builder jar and some other data file as input for building installers. File ProgrammingNotes.txt contains description how to set these input files.


4 InstallShield project description

Product tree consists of 3 elements:

  • Root node 'beanProduct'. It defines whole product and is parent of all nodes in product tree.
  • NetBeans IDE component 'beanCoreIDE'.
    • NetBeans IDE files and file 'netbeans.desktop' used as template to create desktop icon in Gnome Window Manager (Linux/Solaris)
    • PostInstallFixup action performs tasks after installation/uninstallation.
    • Desktop Icon creates/removes desktop icon on Windows.
    • Programs Menu creates/removes items in Programs menu on Windows.
  • Storage Builder component 'beanStorageBuilder'.
    • Storage Builder files
    • Storage Builder action runs storage builder during installation. Storage builder is run as separate process. Shell script (Linux/Solaris) or batch file (Windows) is started from installer. Script starts Java process which runs storage builder. Installer waits till script finishes. Progress bar is also updated according to storage builder progress. Estimation is computed from disk usage used by temporary files generated by storage builder.


5 Installer sequence

Installer sequence defines wizard panels/actions which are shown/performed during installation.

5.1 Set System Properties Action

This action sets/resolves version dependent product bean properties. It is done to keep all version dependent properties at one place. It also disable storage builder component (ie. storage builder will not run during installation) on Windows 95, Windows 98 and Windows ME. (It is done to avoid problems with running batch file on these OS versions.)

5.2 Welcome Panel

Welcome panel informs user about product and its version which is going to be installed.

5.3 License Panel

License panel shows Software License Agreement for NetBeans IDE. User must agree with SLA to continue with installation. There is radio button which must be selected by user. When it is done Next button is enabled.

5.4 Install Location Panel

In this panel user can select NetBeans IDE install location. Default install location is at user home dir. User can either directly edit install location in edit box or press Browse button to invoke file chooser dialog to select install location. This panel is subclass of com.installshield.product.wizardbeans.DestinationPanel and it does validation of selected install location.

5.5 Invalid Install Location

Install location is checked if it is valid. If not panel with error message is displayed and installation will not continue. User can either return back to previous panel and enter valid install location or user can cancel installation.

There is ValidInstallLocationCondition to check validity of install location.

5.6 JDK Search Action

This action looks for installed JDKs with version greater or equal to 1.4.2. On Linux/Solaris it looks at default locations. On Windows it looks at registry.

5.7 JDK Selection Panel

It shows list of JDKs found by JDK Search Action. User can select JDK which will be used by IDE. IDE configuration file netbeans.conf is modified. User can also use Browse button to invoke directory chooser to select JDK installation not found by JDK search action.

5.8 Install Check

It performs standard InstallShield checks on target machine like free disk space check. It displays panel with error message when any of check fails. If checks pass installation continues with next panel.

5.9 Pre-install Summary

It shows information about what product will be installed where it will be installed and how much disk space it will take.

5.10 Install

Install action performs actual installation. It shows panel with progress bar.

5.11 Post Install Wizard Action

On Windows it adds info to registry below Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\<NB UID>. It sets display icon and install location so that NetBeans icon and NetBeans installed size are displayed correctly in Add or Remove Programs dialog.

5.12 Post-install Summary

It informs user what and where was installed. It also shows how to run and uninstall Netbeans IDE.


6 Uninstaller sequence

Uninstaller sequence defines wizard panels/actions which are shown/performed during uninstallation. Uninstaller should remove all files/directories created during installation.

6.1 Welcome Panel

It informs user what will be done during uninstallation.

6.2 Pre-uninstall Summary

It informs user what and from where it will be uninstalled.

6.3 Uninstall

It informs user about uninstallation in progress. No progress bar is shown.

6.4 Post-uninstall Summary

It informs user what was done and eventually shows errors/warnings which occurred during uninstallation. It also shows info about user dir which is not removed by uninstaller.


7 JVM resolution

Installers are built as binary executable files. Native launcher for corresponding platform is used to start installer. Native launcher also look for JDK to run installer on. Required JDK is the same as JDK required by IDE. JRE is not accepted as JRE is not enough to run IDE. Rules for JVM resolution are set using InstallShield text jvm files. JDK versions are searched in following order (applies to Sun JDK as currently no other vendor provides JDK version > 1.4.2, though we do not require any specific vendor in JVM search instructions):

  • JDK 1.5.0_X
  • JDK 1.4.2_X
  • JDK 1.6.0_X
Following JDKs (in alphabetical order) are accepted
  • Linux
    • Blackdown JDK 1.4.2
    • IBM JDK 1.4.2
    • Sun JDK 1.4.2_X
    • Sun JDK 1.5.0_X
    • Sun JDK 1.6.0_X
  • Solaris Sparc/x86
    • Sun JDK 1.4.2_X
    • Sun JDK 1.5.0_X
    • Sun JDK 1.6.0_X
  • Windows
    • IBM JDK 1.4.2
    • Sun JDK 1.4.2_X
    • Sun JDK 1.5.0_X
    • Sun JDK 1.6.0_X
Search instructions contain some generic and some platform specific hints to locate JDK installed in system. Generic hint is list of typical (default) locations of JDK called path hint. Platform specific hints are:
  • Value of environment variables JDK_HOME, JDKHOME, JAVA_PATH, JAVA_HOME on Linux/Solaris
  • Registry entries specific for Sun/IBM JDK on Windows
Search instruction files are shared among installer projects and are located at /cvs/installer/lib/resources and have suffix 'jvm'.


8 Platform specific settings

8.1 Linux/Solaris

Default L&F is set to Metal L&F. Also panel background color is set to [230,230,230] because default panel background color on JDK 1.5.0 is too dark.

8.2 Windows

Default L&F is native. It means XP L&F on Windows XP and Classic L&F on Windows 2000 and older.

Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by