Installer - Advanced tasks

  
 previous up next 


On this tab of the Installer step you can optionally configure advanced handlers to customize the installation process.
  Please see the install4j API for further information on developing custom code.
  • Startup handler
    An startup handler is derived from com.install4j.api.StartupHandler and is executed before the installer or uninstaller wizard is displayed. In the startup handler you can check the suitability of the target system for installation and cancel the installation if necessary.

    Example:
    Do not allow installations on Windows 98.

  • Directory validator
    An directory validator is derived from com.install4j.api.DirectoryValidator and is queried by the installation location screen after the user has selected an installation directory. The directory validator can reject directory and can replace the selected directory with a different actual installation directory.

    Example 1:
    Prevent the user from choosing an installation directory with spaces.

    Example 2:
    Add-on for existing application. The user has to select a Tomcat 5 installation, the directory validator then returns a sub-directory of the selected Tomcat 5 directory, so that the add-on has its own directory. For this to work, suggest application directory has to be disabled on the installation location screen configuration on the Installer features tab.

  • Installation handler
    An installation handler is derived from com.install4j.api.InstallationHandler and is queried by the installer each time before a file is actually installed. The installation handler can re-direct or suppress the installation of each file.

    Example 1:
    Install parts of the distribution tree to the system32 directory of Windows.

    Example 2:
    See example 2 for the directory validator. Some or all files would have to be installed to the parent directory. This can be achieved with an installation handler.