use of com.google.security.zynamics.binnavi.Startup.CommandlineOptions in project binnavi by google.
the class CMain method main.
/**
* Program entry function.
*
* @param args Command line parameters that were passed to the program.
*/
public static void main(final String[] args) {
// ATTENTION: IF YOU'RE NOT READING THE CONFIG FILE FIRST YOU'RE PROBABLY DOING SOMETHING WRONG.
CSettingsDirectoryCreator.createSettingsDirectory();
final boolean firstStart = !CConfigurationFileCreator.setupConfigurationFile();
BuildVersionInformation.loadBuildVersionInformation();
// ESCA-JAVA0266:
// ATTENTION: DO NOT MOVE THE LINE BELOW ABOVE THE CONFIG FILE STUFF
// Don't remove this line, it actually works from inside JAR files
System.out.printf("Starting %s%n", Constants.PROJECT_NAME_VERSION_BUILD);
CGraphPanelExtender.extend();
GuiInitializer.initialize();
if (firstStart) {
final CDatabase newDatabase = new CDatabase("Click and configure me", "org.postgresql.Driver", "localhost", "new_database", "user", "password", "identity", false, false);
CDatabaseManager.instance().addDatabase(newDatabase);
}
prepareDatabaseConnections();
final PluginRegistry pluginRegistry = new PluginRegistry();
final String startPath = FileUtils.findLocalRootPath(CMain.class);
Constants.startPath = startPath;
NaviLogger.info("Defaulting startup path to %s", startPath);
final CDatabaseManager databaseManager = CDatabaseManager.instance();
final PluginInterface pluginInterface = PluginInterface.instance(startPath, databaseManager, pluginRegistry);
final CProjectMainFrame window = new CProjectMainFrame(databaseManager, ConfigManager.instance(), firstStart);
pluginInterface.setMainWindow(new MainWindow(window));
pluginInterface.reloadPlugins();
final CommandlineOptions options = CommandlineParser.parseCommandLine(args);
if (options.getBatchPlugin() != null) {
CBatchPluginExecuter.execute(options.getBatchPlugin(), pluginRegistry);
}
window.setVisible(true);
GuiHelper.applyWindowFix(window);
}
Aggregations