Step 2: Configure executable

  
 previous up next 


In this step of the generated launcher wizard, you enter the properties of the executable that is to be generated.
  The following properties of the executable can be edited in the Executable section of this step:
  • Executable type
    Executables created by install4j can be either GUI applications, console applications or service applications (enterprise edition only)
    • GUI aplication
      There is no terminal window associated with a GUI application. If stdout and stderr are not redirected (see the redirection advanced step), both streams are inaccessible for the user. This corresponds to the behavior of javaw(.exe).
    • Console application
      A console application has an associated terminal window. If a console application is opened from the Windows explorer, a new terminal window is opened. If stdout and stderr are not redirected (see the redirection advanced step), both streams are printed on the terminal window. This corresponds to the behavior of java(.exe).
    • Service application (enterprise edition only)
      A service runs independently of logged in users and can be run even if no user is logged on. A service cannot rely on the presence of a console, nor can it open windows. On Microsoft Windows, a service executable will be compiled by install4, on Mac OS X a startup item will be created and on Unix-like platforms a start/stop script will be generated.

      When you develop a service please note the following requirement: The main method will be called when the service is started. The main method must should in a relatively short time (about 20 seconds) to signal successful initialization to the service manager or init system.

      To handle the shutdown of the service, you can use the Runtime.addShutdownHook() method to register a thread that will be executed before the JVM is terminated.

      For information on how services are installed or uninstalled, please see the help on service options.

  • Executable name
    Enter the desired name of the executable without any trailing .exe or .sh.
  • Directory
    Enter the directory in the distribution tree where the executable should be generated. If you leave this field empty, the executable will be generated in the installation root directory. You can select a directory from the directory tree by clicking the [...] chooser button.
  • Allow only a single running instance of the application
    If you select this checkbox, the generated executable can only be started once. Subsequent user invocations will bring the application to the front. In the Controller class of the install4j launcher client API you can register a startup handler to receive the command line parameters. In this way, you can handle file associations with a single application instance. This feature is only implemented on Microsoft Windows, on Mac OS X, single bundle media files always behave this way.
  • Fail if an exception in the main thread is thrown
    Executables created by install4j can monitor whether the main method throws an exception and show an error dialog in that case. This provides a generic startup error notification facility for the developer that handles a range of errors that would otherwise not be notified correctly. For example, if an uncaught exception is thrown during application startup, a GUI application might simply hang, leaving the user in the dark about the reasons for the malfunction. With the error message provided by the install4j executable, reasons for startup errors are found much more easily.
  • Working directory
    For some applications (especially GUI applications) you might want to change the working directory to a specific directory relative to the executable, for example to read config files that are in a fixed location. To do so, please select the Change working directory to: checkbox and enter a directory relative to the executable in the adjacent text field. To change the current directory to the same directory where the executable is located, please enter a single dot.
  Click [Next] to proceed to the next step or [Cancel] to leave the generated launcher wizard without applying any changes.