Esempio n. 1
0
        private async Task <MO2Compiler> ConfigureAndRunCompiler(string profile)
        {
            var compiler = new MO2Compiler(
                mo2Folder: utils.MO2Folder,
                mo2Profile: profile,
                outputFile: profile + Consts.ModListExtension);

            Assert.IsTrue(await compiler.Begin());
            return(compiler);
        }
Esempio n. 2
0
        protected async Task <MO2Compiler> ConfigureAndRunCompiler(string profile)
        {
            var compiler = new MO2Compiler(
                mo2Folder: utils.MO2Folder,
                mo2Profile: profile,
                outputFile: OutputFile(profile));

            Assert.True(await compiler.Begin());
            return(compiler);
        }
Esempio n. 3
0
        public async Task CreateModlist()
        {
            var profile = utils.AddProfile("Default");
            var mod     = utils.AddMod();

            await DownloadAndInstall(
                "https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z",
                "Mod.Organizer.2.2.1.7z",
                utils.MO2Folder);

            File.WriteAllLines(Path.Combine(utils.DownloadsFolder, "Mod.Organizer.2.2.1.7z.meta"),
                               new List <string>
            {
                "[General]",
                "directURL=https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z"
            });

            var modfiles = await Task.WhenAll(
                DownloadAndInstall(Game.SkyrimSpecialEdition, 12604, "SkyUI"),
                DownloadAndInstall(Game.Fallout4, 11925, "Anti-Tank Rifle"),
                DownloadAndInstall(Game.SkyrimSpecialEdition, 4783, "Frost Armor UNP"),
                DownloadAndInstall(Game.SkyrimSpecialEdition, 32359, "Frost Armor HDT"));

            // We're going to fully patch this mod from another source.
            File.Delete(modfiles[3].Download);

            utils.Configure();

            File.WriteAllLines(Path.Combine(modfiles[3].ModFolder, "meta.ini"), new []
            {
                "[General]",
                $"matchAll= {Path.GetFileName(modfiles[2].Download)}"
            });


            var modlist = await CompileAndInstall(profile);

            utils.VerifyAllFiles();

            var loot_folder = Path.Combine(utils.InstallFolder, "LOOT Config Files");

            if (Directory.Exists(loot_folder))
            {
                Utils.DeleteDirectory(loot_folder);
            }

            var compiler = new MO2Compiler(
                mo2Folder: utils.InstallFolder,
                mo2Profile: profile,
                outputFile: profile + Consts.ModListExtension);

            compiler.MO2DownloadsFolder = Path.Combine(utils.DownloadsFolder);
            Assert.IsTrue(await compiler.Begin());
        }
Esempio n. 4
0
        protected async Task <MO2Compiler> ConfigureAndRunCompiler(string profile)
        {
            var compiler = new MO2Compiler(
                mo2Folder: utils.MO2Folder,
                mo2Profile: profile,
                outputFile: profile + ExtensionManager.Extension);

            compiler.ShowReportWhenFinished = false;
            Assert.IsTrue(await compiler.Begin());
            return(compiler);
        }
Esempio n. 5
0
        protected async Task <MO2Compiler> ConfigureAndRunCompiler(string profile, bool useGameFiles = false)
        {
            var compiler = new MO2Compiler(
                sourcePath: utils.SourcePath,
                downloadsPath: utils.DownloadsPath,
                mo2Profile: profile,
                outputFile: OutputFile(profile));

            compiler.UseGamePaths = useGameFiles;
            Assert.True(await compiler.Begin());
            return(compiler);
        }
Esempio n. 6
0
        public async Task CreateModlist()
        {
            var profile = utils.AddProfile("Default");
            var mod     = await utils.AddMod();

            await DownloadAndInstall(
                "https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z",
                "Mod.Organizer.2.2.1.7z");

            await utils.DownloadsPath.Combine("Mod.Organizer.2.2.1.7z.meta").WriteAllLinesAsync(
                "[General]",
                "directURL=https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z"
                );

            var modfiles = await Task.WhenAll(
                DownloadAndInstall(Game.SkyrimSpecialEdition, 12604, "SkyUI"),
                DownloadAndInstall(Game.Fallout4, 11925, "Anti-Tank Rifle"),
                DownloadAndInstall(Game.SkyrimSpecialEdition, 4783, "Frost Armor UNP"),
                DownloadAndInstall(Game.SkyrimSpecialEdition, 32359, "Frost Armor HDT"),
                DownloadAndInstall("https://github.com/ShikyoKira/Project-New-Reign---Nemesis-Main/releases/download/v0.84-beta/Nemesis.Unlimited.Behavior.Engine.v0.84-beta.rar", "Nemesis.Unlimited.Behavior.Engine.v0.84-beta.rar", "Nemesis"),
                DownloadAndInstall(Game.Fallout4, 40136, "RAR test File")); // ShouldPullFrom Mirror

            // We're going to fully patch this mod from another source.
            await modfiles[3].Download.DeleteAsync();

            await utils.Configure();

            await modfiles[3].ModFolder.Combine("meta.ini").WriteAllLinesAsync(
                "[General]",
                $"matchAll= {modfiles[2].Download.FileName}"
                );

            await utils.SourcePath.Combine("startup.bat").WriteAllLinesAsync(
                "ModOrganizer2.exe SKSE"
                );


            await CompileAndInstall(profile);

            await utils.VerifyAllFiles();

            await utils.InstallPath.Combine(Consts.LOOTFolderFilesDir).DeleteDirectory();

            var compiler = new MO2Compiler(
                sourcePath: utils.InstallPath,
                downloadsPath: utils.DownloadsPath,
                mo2Profile: profile,
                outputFile: profile.RelativeTo(AbsolutePath.EntryPoint).WithExtension(Consts.ModListExtension));

            Assert.True(await compiler.Begin());
        }
Esempio n. 7
0
        public async Task CreateModlist()
        {
            var profile = utils.AddProfile("Default");
            var mod     = utils.AddMod();

            await DownloadAndInstall(
                "https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z",
                "Mod.Organizer.2.2.1.7z");

            await utils.DownloadsFolder.Combine("Mod.Organizer.2.2.1.7z.meta").WriteAllLinesAsync(
                "[General]",
                "directURL=https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z"
                );

            var modfiles = await Task.WhenAll(
                DownloadAndInstall(Game.SkyrimSpecialEdition, 12604, "SkyUI"),
                DownloadAndInstall(Game.Fallout4, 11925, "Anti-Tank Rifle"),
                DownloadAndInstall(Game.SkyrimSpecialEdition, 4783, "Frost Armor UNP"),
                DownloadAndInstall(Game.SkyrimSpecialEdition, 32359, "Frost Armor HDT"));

            // We're going to fully patch this mod from another source.
            modfiles[3].Download.Delete();

            await utils.Configure();

            await modfiles[3].ModFolder.Combine("meta.ini").WriteAllLinesAsync(
                "[General]",
                $"matchAll= {modfiles[2].Download.FileName}"
                );

            await utils.MO2Folder.Combine("startup.bat").WriteAllLinesAsync(
                "ModOrganizer2.exe SKSE"
                );


            await CompileAndInstall(profile);

            utils.VerifyAllFiles();

            await utils.InstallFolder.Combine(Consts.LOOTFolderFilesDir).DeleteDirectory();

            var compiler = new MO2Compiler(
                mo2Folder: utils.InstallFolder,
                mo2Profile: profile,
                outputFile: profile.RelativeTo(AbsolutePath.EntryPoint).WithExtension(Consts.ModListExtension));

            compiler.MO2DownloadsFolder = utils.DownloadsFolder;
            Assert.True(await compiler.Begin());
        }
Esempio n. 8
0
        public async Task <GetResponse <ModList> > Compile()
        {
            string outputFile;

            if (string.IsNullOrWhiteSpace(Parent.OutputLocation.TargetPath))
            {
                outputFile = MOProfile + Consts.ModListExtension;
            }
            else
            {
                outputFile = Path.Combine(Parent.OutputLocation.TargetPath, MOProfile + Consts.ModListExtension);
            }

            try
            {
                using (ActiveCompilation = new MO2Compiler(
                           mo2Folder: Mo2Folder,
                           mo2Profile: MOProfile,
                           outputFile: outputFile)
                {
                    ModListName = ModlistSettings.ModListName,
                    ModListAuthor = ModlistSettings.AuthorText,
                    ModListDescription = ModlistSettings.Description,
                    ModListImage = ModlistSettings.ImagePath.TargetPath,
                    ModListWebsite = ModlistSettings.Website,
                    ModListReadme = ModlistSettings.ReadmeIsWebsite ? ModlistSettings.ReadmeWebsite : ModlistSettings.ReadmeFilePath.TargetPath,
                    ReadmeIsWebsite = ModlistSettings.ReadmeIsWebsite,
                    MO2DownloadsFolder = DownloadLocation.TargetPath,
                })
                {
                    Parent.MWVM.Settings.Performance.AttachToBatchProcessor(ActiveCompilation);

                    var success = await ActiveCompilation.Begin();

                    return(GetResponse <ModList> .Create(success, ActiveCompilation.ModList));
                }
            }
            finally
            {
                StatusTracker     = null;
                ActiveCompilation = null;
            }
        }
Esempio n. 9
0
        public async Task CreateModlist()
        {
            var profile = utils.AddProfile("Default");
            var mod     = utils.AddMod();

            await DownloadAndInstall(
                "https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z",
                "Mod.Organizer.2.2.1.7z",
                utils.MO2Folder);

            File.WriteAllLines(Path.Combine(utils.DownloadsFolder, "Mod.Organizer.2.2.1.7z.meta"),
                               new List <string>
            {
                "[General]",
                "directURL=https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.1/Mod.Organizer.2.2.1.7z"
            });

            await DownloadAndInstall(Game.SkyrimSpecialEdition, 12604, "SkyUI");

            utils.Configure();

            var modlist = await CompileAndInstall(profile);

            utils.VerifyAllFiles();

            var loot_folder = Path.Combine(utils.InstallFolder, "LOOT Config Files");

            if (Directory.Exists(loot_folder))
            {
                Utils.DeleteDirectory(loot_folder);
            }

            var compiler = new MO2Compiler(
                mo2Folder: utils.InstallFolder,
                mo2Profile: profile,
                outputFile: profile + ExtensionManager.Extension);

            compiler.MO2DownloadsFolder     = Path.Combine(utils.DownloadsFolder);
            compiler.ShowReportWhenFinished = false;
            Assert.IsTrue(await compiler.Begin());
        }
Esempio n. 10
0
        public async Task Compile()
        {
            string outputFile;

            if (string.IsNullOrWhiteSpace(Parent.OutputLocation.TargetPath))
            {
                outputFile = MOProfile + ExtensionManager.Extension;
            }
            else
            {
                outputFile = Path.Combine(Parent.OutputLocation.TargetPath, MOProfile + ExtensionManager.Extension);
            }

            try
            {
                ActiveCompilation = new MO2Compiler(
                    mo2Folder: Mo2Folder,
                    mo2Profile: MOProfile,
                    outputFile: outputFile)
                {
                    ModListName        = ModlistSettings.ModListName,
                    ModListAuthor      = ModlistSettings.AuthorText,
                    ModListDescription = ModlistSettings.Description,
                    ModListImage       = ModlistSettings.ImagePath.TargetPath,
                    ModListWebsite     = ModlistSettings.Website,
                    ModListReadme      = ModlistSettings.ReadmeIsWebsite ? ModlistSettings.ReadmeWebsite : ModlistSettings.ReadmeFilePath.TargetPath,
                    ReadmeIsWebsite    = ModlistSettings.ReadmeIsWebsite,
                };
                await ActiveCompilation.Begin();
            }
            finally
            {
                StatusTracker = null;
                ActiveCompilation.Dispose();
                ActiveCompilation = null;
            }
        }