private async void VerifyGame()
        {
            await Task.Yield();

            ResultGameVerification result = GameVerification.VerifyGame(model.PathToSkyrim, "");

            if (result.IsGameFound)
            {
                model.SkyrimVersion = result.GameVersion.ToString();
                if (result.IsSKSEFound)
                {
                    model.SKSEVersion = result.SKSEVersion.ToString();
                }
                else
                {
                    model.SKSEVersion = Res.SKSENotFound;
                }
                Result           = result;
                model.CanInstall = true;
            }
            else
            {
                model.SkyrimVersion = Res.GameNotFound;
                model.SKSEVersion   = "-";
                model.CanInstall    = false;
            }
        }
Exemple #2
0
        private ResultGameVerification CheckSkyrim()
        {
            string pathToSkyrim           = Settings.PathToSkyrim;
            ResultGameVerification result = default;

            try
            {
                do
                {
                    while (string.IsNullOrEmpty(pathToSkyrim) || !Directory.Exists(pathToSkyrim))
                    {
                        string path = GameVerification.GetGameFolder();
                        if (string.IsNullOrEmpty(path))
                        {
                            App.AppCurrent.Shutdown();
                            Close();
                        }
                        pathToSkyrim = path;
                    }

                    result = GameVerification.VerifyGame(pathToSkyrim, null);
                    if (result.IsGameFound)
                    {
                        if (Settings.PathToSkyrim != pathToSkyrim)
                        {
                            Settings.PathToSkyrim = pathToSkyrim;
                            Settings.Save();
                        }
                        break;
                    }

                    pathToSkyrim = null;
                    MessageBox.Show(Res.SkyrimNotFound, Res.Error);
                } while (true);
            }
            catch (Exception er)
            {
                Logger.FatalError("CheckPathToSkyrim", er);
                MessageBox.Show(Res.InitError, Res.Error);
                Close();
            }

            return(result);
        }
Exemple #3
0
 private void SelectSkyrimPath(object sender, RoutedEventArgs e)
 {
     Model.SkyrimPath = GameVerification.GetGameFolder() ?? Settings.PathToSkyrim;
 }
Exemple #4
0
        private async Task CheckGame()
        {
            string pathToSkyrim           = Settings.PathToSkyrim;
            ResultGameVerification result = default;

            try
            {
                do
                {
                    while (string.IsNullOrEmpty(pathToSkyrim) || !Directory.Exists(pathToSkyrim))
                    {
                        string path = GameVerification.GetGameFolder();
                        if (string.IsNullOrEmpty(path))
                        {
                            App.AppCurrent.Shutdown();
                            Close();
                            return;
                        }
                        pathToSkyrim = path;
                    }

                    result = GameVerification.VerifyGame(pathToSkyrim, null);
                    if (result.IsGameFound)
                    {
                        if (Settings.PathToSkyrim != pathToSkyrim)
                        {
                            Settings.PathToSkyrim = pathToSkyrim;
                            Settings.Save();
                        }
                        break;
                    }

                    pathToSkyrim = null;
                    MessageBox.Show(Res.SkyrimNotFound, Res.Error);
                } while (true);
            }
            catch (Exception er)
            {
                Logger.FatalError("Wind_Loaded_1", er);
                MessageBox.Show(Res.InitError, Res.Error);
                Close();
            }

            ModVersion.Load();
            FileWatcher.Init();

            try
            {
                if (!result.IsSKSEFound && MessageBox.Show(Res.SKSENotFound, Res.Warning, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    await InstallSKSE();
                }
                if (!result.IsRuFixConsoleFound &&
                    ModVersion.HasRuFixConsole == null &&
                    MessageBox.Show(Res.SSERFix, Res.Warning, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    await InstallRuFixConsole();

                    ModVersion.Save();
                }
                else
                {
                    ModVersion.HasRuFixConsole = result.IsRuFixConsoleFound;
                    ModVersion.Save();
                }
            }
            catch (Exception er)
            {
                Logger.FatalError("Wind_Loaded_2", er);
            }
        }
 private void SelectSkyrimPath(object sender, RoutedEventArgs e)
 {
     model.PathToSkyrim = GameVerification.GetGameFolder() ?? model.PathToSkyrim;
     VerifyGame();
 }