NBIExtendingCommandLineOptions

Extending NBI command line options

There is a possiblity to use your own command-line options handlers in any installer engine extension.
To do that you should do the following:

  • Write new class, extended from org.netbeans.installer.utils.cli.CLIOption (CLIOptionZeroArguments|CLIOptionOneArgument|CLIOptionTwoArguments)
    You should specify, at least, two things - the command-line argument (via getName() method)) and implement execute() method
  • Add its full name in a new line at engine/data/clioptions.list
  • Do not forget to include "data/clioptions.list" in the mask when calling write-jar-content-list task during engine build.

Those handlers are executed at the very beginning of installer`s work.
At this early moment you should not use (Installer|DownloadManager|Wizard|Registry|FileProxy).getInstance().
LogManager is not yet started as well but you can use it and all messages will be written to the log file when it is started.
The good practice is to set light "switches" at this handlers (e.g. system properties).

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo