Class StartupNotification

java.lang.Object
com.install4j.api.launcher.StartupNotification

public class StartupNotification extends Object

This class allows you to register a listener to receive startup events in single instance mode on Microsoft Windows and file open events on macOS.

On macOS, this is a facade for the platform-specific Java extensions. If you want to use additional features, please use the com.apple.eawt classes directly that are available in all pre-Java 9 macOS JREs or the new Java 9 java.awt.desktop functionality.
  • Constructor Details

    • StartupNotification

      public StartupNotification()
  • Method Details

    • registerStartupListener

      public static void registerStartupListener(StartupNotification.Listener listener)
      Register a listener to receive startup events in single instance mode on Microsoft Windows or to receive file open events on macOS. Request that are already queued may be invoked immediately on the startup listener before this call returns. Subsequent calls will be from different threads.

      On macOS, you must register this listener on the main thread of your application, otherwise the initial file open event may be lost.

      Parameters:
      listener - the listener
    • setHandleQuit

      public static void setHandleQuit(boolean handleQuit)
      Sets if the Quit command should be handled on macOS (that means if the application should quit when the command is invoked). This is true be default.
      Parameters:
      handleQuit - true if quit should be handled