예제 #1
0
        private async void checkUpdatesNow_Click(object sender, RoutedEventArgs e)
        {
            optionsrequest = true;
            string update = await AutoUpdater.CheckVersion();

            if (Window1.versionok == false)
            {
                Window1.singleton.MainPage.Navigate(new Pages.SplashScreen());
            }
            await AutoUpdater.Download(update);

            optionsrequest = false;
        }
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                var client   = new WebClient();
                var values   = new System.Collections.Specialized.NameValueCollection();
                var response = await client.UploadValuesTaskAsync(config.launcherStatusWebService, values);

                var responseString = Encoding.Default.GetString(response);
                if (responseString.Contains("disabled"))
                {
                    MessageBox.Show(SplashScreen.singleton.manager.GetString("launcherMaintenance"));
                    Application.Current.Shutdown();
                }
            }
            catch { }

            Windows.DebugOutputConsole console = new Windows.DebugOutputConsole();
            if (Window1.singleton.started == false)
            {
                Window1.singleton.started = true;


                string update = await AutoUpdater.CheckVersion();

                await AutoUpdater.Download(update);


                //SETTING UP JAVA
                if (await JAVAInstaller.isJavaInstalled() == false)
                {
                    await JAVAInstaller.DownloadJava();
                }
                transition.SelectedIndex = 1;
                await Task.Delay(350);

                Window1.singleton.MainPage.Navigate(new Pages.Login());
            }
        }