示例#1
0
        protected async override void OnStartup(StartupEventArgs e)
        {
            ShutdownMode = ShutdownMode.OnMainWindowClose;

            DispatcherUnhandledException += App_DispatcherUnhandledException;
            RegistryConfig.InstallGBHandler();
            MainWindow mw      = new MainWindow();
            bool       running = AlreadyRunning();

            if (!running)
            {
                mw.Show();
                // Only check for updates if FileDaddy wasn't launched by 1-click install button
                if (e.Args.Length == 0)
                {
                    if (await AutoUpdater.CheckForFileDaddyUpdate(new CancellationTokenSource()))
                    {
                        mw.Close();
                    }
                }
            }
            if (e.Args.Length > 1 && e.Args[0] == "-download")
            {
                new ModDownloader().Download(e.Args[1], running);
            }
            else if (running)
            {
                MessageBox.Show("FileDaddy is already running", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }
示例#2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ShutdownMode = ShutdownMode.OnMainWindowClose;

            DispatcherUnhandledException += App_DispatcherUnhandledException;
            RegistryConfig.InstallGBHandler();
            MainWindow mw      = new MainWindow();
            bool       running = AlreadyRunning();

            if (!running)
            {
                mw.Show();
            }
            if (e.Args.Length > 1 && e.Args[0] == "-download")
            {
                new ModDownloader().Download(e.Args[1], running);
            }
        }