+ int configResult = fgInitConfig(argc, argv, false);
+ if (configResult == flightgear::FG_OPTIONS_ERROR) {
+ return EXIT_FAILURE;
+ } else if (configResult == flightgear::FG_OPTIONS_EXIT) {
+ return EXIT_SUCCESS;
+ }
+
+ // launcher needs to know the aircraft paths in use
+ fgInitAircraftPaths(false);
+
+#if defined(HAVE_QT)
+ bool showLauncher = flightgear::Options::checkForArg(argc, argv, "launcher");
+ // an Info.plist bundle can't define command line arguments, but it can set
+ // environment variables. This avoids needed a wrapper shell-script on OS-X.
+ showLauncher |= (::getenv("FG_LAUNCHER") != 0);
+
+ if (showLauncher) {
+ QtLauncher::initApp(argc, argv);
+ if (!QtLauncher::runLauncherDialog()) {
+ return EXIT_SUCCESS;
+ }
+ }
+#endif
+
+ configResult = fgInitAircraft(false);
+ if (configResult == flightgear::FG_OPTIONS_ERROR) {
+ return EXIT_FAILURE;
+ } else if (configResult == flightgear::FG_OPTIONS_EXIT) {
+ return EXIT_SUCCESS;
+ }
+
+ configResult = flightgear::Options::sharedInstance()->processOptions();