public async Task <bool> Install()
        {
            AInstaller installer;

            var download = VortexCompiler.RetrieveDownloadLocation(TargetGame);
            var staging  = VortexCompiler.RetrieveStagingLocation(TargetGame);

            using (installer = new VortexInstaller(
                       archive: Parent.ModListLocation.TargetPath,
                       modList: Parent.ModList.SourceModList,
                       outputFolder: staging,
                       downloadFolder: download,
                       parameters: SystemParametersConstructor.Create()))
            {
                Parent.MWVM.Settings.Performance.AttachToBatchProcessor(installer);

                return(await Task.Run(async() =>
                {
                    try
                    {
                        var workTask = installer.Begin();
                        ActiveInstallation = installer;
                        return await workTask;
                    }
                    finally
                    {
                        ActiveInstallation = null;
                    }
                }));
            }
        }
Beispiel #2
0
        public async Task <bool> Install()
        {
            using (var installer = new MO2Installer(
                       archive: Parent.ModListLocation.TargetPath,
                       modList: Parent.ModList.SourceModList,
                       outputFolder: Location.TargetPath,
                       downloadFolder: DownloadLocation.TargetPath,
                       parameters: SystemParametersConstructor.Create()))
            {
                Parent.MWVM.Settings.Performance.AttachToBatchProcessor(installer);

                return(await Task.Run(async() =>
                {
                    try
                    {
                        var workTask = installer.Begin();
                        ActiveInstallation = installer;
                        return await workTask;
                    }
                    finally
                    {
                        ActiveInstallation = null;
                    }
                }));
            }
        }
Beispiel #3
0
        public MainWindow()
        {
            // Wire any unhandled crashing exceptions to log before exiting
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                // Don't do any special logging side effects
                Utils.Error(((Exception)e.ExceptionObject), "Uncaught error");
            };

            Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
            var p = SystemParametersConstructor.Create();

            Utils.Log($"Detected Windows Version: {p.WindowsVersion}");

            if (!(p.WindowsVersion.Major >= 6 && p.WindowsVersion.Minor >= 2))
            {
                Utils.Log(
                    $"You are not running a recent version of Windows (version 10 or greater), Wabbajack is not supported on OS versions older than Windows 10.");
            }

            Utils.Log(
                $"System settings - ({p.SystemMemorySize.ToFileSizeString()} RAM), Display: {p.ScreenWidth} x {p.ScreenHeight} ({p.VideoMemorySize.ToFileSizeString()} VRAM - VideoMemorySizeMb={p.EnbLEVRAMSize})");

            Warmup();

            var(settings, loadedSettings) = MainSettings.TryLoadTypicalSettings().AsTask().Result;
            // Load settings
            if (CLIArguments.NoSettings || !loadedSettings)
            {
                _settings = new MainSettings
                {
                    Version = Consts.SettingsVersion
                };
                RunWhenLoaded(DefaultSettings);
            }
            else
            {
                _settings = settings;
                RunWhenLoaded(LoadSettings);
            }

            // Set datacontext
            _mwvm       = new MainWindowVM(this, _settings);
            DataContext = _mwvm;

            // Bring window to the front if it isn't already
            this.Initialized += (s, e) =>
            {
                this.Activate();
                this.Topmost = true;
                this.Focus();
            };
            this.ContentRendered += (s, e) =>
            {
                this.Topmost = false;
            };
        }
Beispiel #4
0
        private async Task Install(MO2Compiler compiler)
        {
            var modlist   = AInstaller.LoadFromFile(compiler.ModListOutputFile);
            var installer = new MO2Installer(
                archive: compiler.ModListOutputFile,
                modList: modlist,
                outputFolder: utils.InstallFolder,
                downloadFolder: utils.DownloadsFolder,
                parameters: SystemParametersConstructor.Create());

            installer.GameFolder = utils.GameFolder;
            await installer.Begin();
        }
 protected async Task Install(VortexCompiler vortexCompiler)
 {
     var modList   = AInstaller.LoadFromFile(vortexCompiler.ModListOutputFile);
     var installer = new MO2Installer(
         archive: vortexCompiler.ModListOutputFile,
         modList: modList,
         outputFolder: utils.InstallFolder,
         downloadFolder: utils.DownloadsFolder,
         parameters: SystemParametersConstructor.Create())
     {
         GameFolder = utils.GameFolder,
     };
     await installer.Begin();
 }
Beispiel #6
0
        public MainWindow()
        {
            Helpers.Init();
            // Wire any unhandled crashing exceptions to log before exiting
            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
            {
                // Don't do any special logging side effects
                Utils.Error(((Exception)e.ExceptionObject), "Uncaught error");
            };

            Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
            var p = SystemParametersConstructor.Create();

            Utils.Log($"Detected Windows Version: {p.WindowsVersion}");

            if (!(p.WindowsVersion.Major >= 6 && p.WindowsVersion.Minor >= 2))
            {
                Utils.Log(
                    $"You are not running a recent version of Windows (version 10 or greater), Wabbajack is not supported on OS versions older than Windows 10.");
            }

            Utils.Log(
                $"System settings - ({p.SystemMemorySize.ToFileSizeString()} RAM), Display: {p.ScreenWidth} x {p.ScreenHeight} ({p.VideoMemorySize.ToFileSizeString()} VRAM - VideoMemorySizeMb={p.EnbLEVRAMSize})");

            // Run logic to associate wabbajack lists with this app in the background
            Task.Run(async() =>
            {
                var appPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
                try
                {
                    if (!ModListAssociationManager.IsAssociated() || ModListAssociationManager.NeedsUpdating(appPath))
                    {
                        ModListAssociationManager.Associate(appPath);
                    }
                }
                catch (Exception e)
                {
                    Utils.Log($"ExtensionManager had an exception:\n{e}");
                }
            }).FireAndForget();

            // Load settings
            if (CLIArguments.NoSettings || !MainSettings.TryLoadTypicalSettings(out var settings))
            {
                _settings = new MainSettings
                {
                    Version = Consts.SettingsVersion
                };
                RunWhenLoaded(DefaultSettings);
            }
            else
            {
                _settings = settings;
                RunWhenLoaded(LoadSettings);
            }

            // Set datacontext
            _mwvm       = new MainWindowVM(this, _settings);
            DataContext = _mwvm;

            // Bring window to the front if it isn't already
            this.Initialized += (s, e) =>
            {
                this.Activate();
                this.Topmost = true;
                this.Focus();
            };
            this.ContentRendered += (s, e) =>
            {
                this.Topmost = false;
            };
        }
Beispiel #7
0
        public MainWindow()
        {
            try
            {
                // Wire any unhandled crashing exceptions to log before exiting
                AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
                {
                    // Don't do any special logging side effects
                    Utils.LogStraightToFile("Error.");
                    Utils.LogStraightToFile(((Exception)e.ExceptionObject).ToString());
                    Environment.Exit(-1);
                };

                Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
                Utils.Log($"Running in {AbsolutePath.EntryPoint}");

                var p = SystemParametersConstructor.Create();

                Utils.Log($"Detected Windows Version: {p.WindowsVersion}");

                if (!(p.WindowsVersion.Major >= 10 && p.WindowsVersion.Minor >= 0))
                {
                    Utils.Log(
                        $"You are not running a recent version of Windows (version 10 or greater), Wabbajack is not supported on OS versions older than Windows 10.");
                }

                Utils.Log(
                    $"System settings - ({p.SystemMemorySize.ToFileSizeString()} RAM) ({p.SystemPageSize.ToFileSizeString()} Page), Display: {p.ScreenWidth} x {p.ScreenHeight} ({p.VideoMemorySize.ToFileSizeString()} VRAM - VideoMemorySizeMb={p.EnbLEVRAMSize})");

                if (p.SystemPageSize == 0)
                {
                    Utils.Log("Pagefile is disabled! Consider increasing to 20000MB. A disabled pagefile can cause crashes and poor in-game performance.");
                }
                else if (p.SystemPageSize < 2e+10)
                {
                    Utils.Log("Pagefile below recommended! Consider increasing to 20000MB. A suboptimal pagefile can cause crashes and poor in-game performance.");
                }

                Warmup();

                var _ = LauncherUpdater.Run();

                var(settings, loadedSettings) = MainSettings.TryLoadTypicalSettings().AsTask().Result;
                // Load settings
                if (CLIArguments.NoSettings || !loadedSettings)
                {
                    _settings = new MainSettings {
                        Version = Consts.SettingsVersion
                    };
                    RunWhenLoaded(DefaultSettings);
                }
                else
                {
                    _settings = settings;
                    RunWhenLoaded(LoadSettings);
                }

                // Set datacontext
                _mwvm       = new MainWindowVM(this, _settings);
                DataContext = _mwvm;

                // Bring window to the front if it isn't already
                this.Initialized += (s, e) =>
                {
                    this.Activate();
                    this.Topmost = true;
                    this.Focus();
                };
                this.ContentRendered += (s, e) =>
                {
                    this.Topmost = false;
                };
            }
            catch (Exception ex)
            {
                Utils.LogStraightToFile("Error");
                Utils.LogStraightToFile(ex.ToString());
                Environment.Exit(-1);
            }
        }