Exemple #1
0
        public static void GenerateLibraryList()
        {
            if (File.Exists(Definitions.Global.Uplay.ConfigFilePath))
            {
                foreach (var line in File.ReadAllLines(Definitions.Global.Uplay.ConfigFilePath))
                {
                    if (!line.Contains("game_installation_path"))
                    {
                        continue;
                    }

                    var newLine = line.Split(new[] { "  game_installation_path: " }, StringSplitOptions.RemoveEmptyEntries);

                    if (newLine.Length > 0)
                    {
                        if (Directory.Exists(newLine[0]))
                        {
                            AddNewLibraryAsync(newLine[0], true);
                        }
                        else
                        {
                            Logger.Info($"Directory set in the Uplay config file does not exists.\nDirectory path: {newLine[0]}");
                        }
                    }
                    else
                    {
                        Logger.Info("Couldn't parse Uplay config file for 'game_installation_path' - If you can find the value in the file, fill an issue form on github.");
                    }
                }
            }
            else
            {
                Logger.Info("Uplay config file is not found, skipping main uplay library detection.");
            }
        }
Exemple #2
0
        public FolderWatcherManager(WebLibraryDetail _library)
        {
            web_library_detail = new TypedWeakReference <WebLibraryDetail>(_library);

            // Load any pre-existing watched filenames
            bool file_exists;

            // Utilities.LockPerfTimer l1_clk = Utilities.LockPerfChecker.Start();
            lock (filenames_processed_lock)
            {
                // l1_clk.LockPerfTimerStop();
                file_exists = File.Exists(Filename_Store);
            }
            if (file_exists)
            {
                Logging.Info("Loading memory of files that we watched previously.");

                // Utilities.LockPerfTimer l2_clk = Utilities.LockPerfChecker.Start();
                lock (filenames_processed_lock)
                {
                    // l2_clk.LockPerfTimerStop();
                    foreach (string filename in File.ReadAllLines(Filename_Store))
                    {
                        filenames_processed.Add(filename);
                    }
                }
            }

            if (ConfigurationManager.IsEnabled(nameof(FolderWatcher)))
            {
                managed_thread_index = Utilities.Maintainable.MaintainableManager.Instance.RegisterHeldOffTask(TaskDaemonEntryPoint, 30 * 1000, extra_descr: $".Lib({LibraryRef})");
            }
        }
Exemple #3
0
        public FolderWatcherManager(Library library)
        {
            this.library = library;

            // Load any pre-existing watched filenames
            bool file_exists;

            Utilities.LockPerfTimer l1_clk = Utilities.LockPerfChecker.Start();
            lock (filenames_processed_lock)
            {
                l1_clk.LockPerfTimerStop();
                file_exists = File.Exists(Filename_Store);
            }
            if (file_exists)
            {
                Logging.Info("Loading memory of files that we watched previously.");

                Utilities.LockPerfTimer l2_clk = Utilities.LockPerfChecker.Start();
                lock (filenames_processed_lock)
                {
                    l2_clk.LockPerfTimerStop();
                    foreach (string filename in File.ReadAllLines(Filename_Store))
                    {
                        filenames_processed.Add(filename);
                    }
                }
            }

            Utilities.Maintainable.MaintainableManager.Instance.RegisterHeldOffTask(TaskDaemonEntryPoint, 30 * 1000, System.Threading.ThreadPriority.BelowNormal, extra_descr: $".Lib({library})");
        }
Exemple #4
0
        public void TestSearchAndReplaceXPathWithMissingXmlDeclaration(bool useLongPath)
        {
            string destFolder = useLongPath ? GetLongPathDestination(Guid.NewGuid().ToString()) : destinationFolder;

            Utils.CopyFiles(Path.Combine(sourceFolder, "TestCase4"), Path.Combine(destFolder, "TestCase4"), null, null);
            GrepCore core = new GrepCore();
            List <GrepSearchResult> results = core.Search(Directory.GetFiles(Path.Combine(destFolder, "TestCase4"), "books_no_decl.xml"),
                                                          SearchType.XPath, "(//@category)[2]", GrepSearchOption.None, -1);

            Assert.Single(results);
            Assert.Single(results[0].Matches);

            // mark all matches for replace
            foreach (var match in results[0].Matches)
            {
                match.ReplaceMatch = true;
            }

            string            testFile = Path.Combine(destinationFolder, "TestCase4", "books_no_decl.xml");
            List <ReplaceDef> files    = new List <ReplaceDef>
            {
                new ReplaceDef(testFile, results[0].Matches)
            };

            core.Replace(files, SearchType.XPath, "(//@category)[2]", "general", GrepSearchOption.None, -1);

            var fileContent = File.ReadAllLines(testFile, Encoding.UTF8);

            Assert.Equal(37, fileContent.Length);
            Assert.Equal("<bookstore>", fileContent[0]);
            Assert.Equal("  <book category=\"general\">", fileContent[7]);
        }
        public static void RestoreDesktop()
        {
            WPFDoEvents.AssertThisCodeIs_NOT_RunningInTheUIThread();

            try
            {
                // Get the remembrances
                if (File.Exists(Filename))
                {
                    string[] restore_settings = File.ReadAllLines(Filename);
                    foreach (string restore_setting in restore_settings)
                    {
                        try
                        {
                            if (restore_setting.StartsWith("PDF_LIBRARY"))
                            {
                                string[] parts      = restore_setting.Split(',');
                                string   library_id = parts[1];

                                Library library = WebLibraryManager.Instance.GetLibrary(library_id);
                                WPFDoEvents.InvokeInUIThread(() => MainWindowServiceDispatcher.Instance.OpenLibrary(library));
                            }
                            else if (restore_setting.StartsWith("PDF_DOCUMENT"))
                            {
                                string[] parts                = restore_setting.Split(',');
                                string   library_id           = parts[1];
                                string   document_fingerprint = parts[2];

                                Library     library      = WebLibraryManager.Instance.GetLibrary(library_id);
                                PDFDocument pdf_document = library.GetDocumentByFingerprint(document_fingerprint);
                                if (null == pdf_document)
                                {
                                    Logging.Warn("RestoreDesktop: Cannot find document anymore for fingerprint {0}", document_fingerprint);
                                }
                                else
                                {
                                    WPFDoEvents.InvokeInUIThread(() => MainWindowServiceDispatcher.Instance.OpenDocument(pdf_document));
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.Warn(ex, "There was a problem restoring desktop with state {0}", restore_setting);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "There was a problem restoring the saved desktop state.");
            }

            Logging.Warn("Finished restoring desktop.");
        }
Exemple #6
0
        public void TestReplaceOnFileWith_UTF8_BOM(SearchType type, GrepSearchOption option, string searchFor, string replaceWith)
        {
            // Test for Issue #227 dnGrep inserting extra BOM, and scrambling file
            Utils.CopyFiles(Path.Combine(sourceFolder, "TestCase15"), Path.Combine(destinationFolder, "TestCase15"), null, null);
            GrepCore core = new GrepCore();
            List <GrepSearchResult> results = core.Search(Directory.GetFiles(Path.Combine(destinationFolder, "TestCase15"), "books_bom.xml"),
                                                          type, searchFor, option, -1);

            Assert.Single(results);

            // mark all matches for replace
            foreach (var match in results[0].Matches)
            {
                match.ReplaceMatch = true;
            }

            string            testFile = Path.Combine(destinationFolder, "TestCase15", "books_bom.xml");
            List <ReplaceDef> files    = new List <ReplaceDef>
            {
                new ReplaceDef(testFile, results[0].Matches)
            };

            core.Replace(files, type, searchFor, replaceWith, option, -1);

            using (FileStream stream = File.Open(testFile, FileMode.Open, FileAccess.Read, FileShare.Read))
                using (StreamReader reader = new StreamReader(stream, true))
                {
                    Assert.Equal(Encoding.UTF8, reader.CurrentEncoding);
                    // check there is a BOM
                    int bb = reader.BaseStream.ReadByte();
                    Assert.Equal(0xEF, bb);
                    bb = reader.BaseStream.ReadByte();
                    Assert.Equal(0xBB, bb);
                    bb = reader.BaseStream.ReadByte();
                    Assert.Equal(0xBF, bb);
                    // check that there are not two BOMs
                    bb = reader.BaseStream.ReadByte();
                    Assert.NotEqual(0xEF, bb);
                    Assert.Equal('<', bb);
                }
            var fileContent = File.ReadAllLines(Path.Combine(destinationFolder, "TestCase15", "books_bom.xml"), Encoding.UTF8);

            Assert.Equal(38, fileContent.Length);
            string line1 = fileContent[0].Replace("\ufeff", ""); // remove BOM

            Assert.Equal("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", line1);
            Assert.Equal("  <book category=\"general\">", fileContent[8]);
        }
        public List <BlackWhiteListEntry> ReadList()
        {
            List <BlackWhiteListEntry> results = new List <BlackWhiteListEntry>();

            try
            {
                if (!File.Exists(Filename_Store))
                {
                    Logging.Info("No file {0} found, so starting afresh.", Filename_Store);
                }
                else
                {
                    string[] lines = File.ReadAllLines(Filename_Store);
                    foreach (string line in lines)
                    {
                        if (String.IsNullOrEmpty(line))
                        {
                            continue;
                        }

                        // skip comments
                        if (line.StartsWith("#"))
                        {
                            continue;
                        }

                        // Process the line
                        try
                        {
                            BlackWhiteListEntry entry = new BlackWhiteListEntry(line);
                            results.Add(entry);
                        }
                        catch (Exception ex2)
                        {
                            Logging.Warn(ex2, "There was a problem processing AutoTags blacklist/whitelist line:\n\t{0}\n\tFile: {1}", line, Filename_Store);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "Error loading WhiteList file {0}.", Filename_Store);
            }

            return(results);
        }
Exemple #8
0
        public void TestReplaceOnFileWith_UTF8_BOM(SearchType type, GrepSearchOption option, string searchFor, string replaceWith)
        {
            // Test for Issue #227 dnGrep inserting extra BOM, and scrambling file
            Utils.CopyFiles(sourceFolder + "\\TestCase15", destinationFolder + "\\TestCase15", null, null);
            GrepCore core = new GrepCore();
            List <GrepSearchResult> results = core.Search(Directory.GetFiles(destinationFolder + "\\TestCase15", "books_bom.xml"),
                                                          type, searchFor, option, -1);

            Assert.Equal(1, results.Count);
            string testFile = Path.Combine(destinationFolder, @"TestCase15\books_bom.xml");
            Dictionary <string, string> files = new Dictionary <string, string>
            {
                { testFile, Guid.NewGuid().ToString() + ".xml" }
            };

            core.Replace(files, type, searchFor, replaceWith, option, -1);

            using (FileStream stream = File.Open(testFile, FileMode.Open, FileAccess.Read, FileShare.Read))
                using (StreamReader reader = new StreamReader(stream, true))
                {
                    Assert.Equal(Encoding.UTF8, reader.CurrentEncoding);
                    // check there is a BOM
                    int bb = reader.BaseStream.ReadByte();
                    Assert.Equal(0xEF, bb);
                    bb = reader.BaseStream.ReadByte();
                    Assert.Equal(0xBB, bb);
                    bb = reader.BaseStream.ReadByte();
                    Assert.Equal(0xBF, bb);
                    // check that there are not two BOMs
                    bb = reader.BaseStream.ReadByte();
                    Assert.NotEqual(0xEF, bb);
                    Assert.Equal('<', bb);
                }
            var fileContent = File.ReadAllLines(destinationFolder + "\\TestCase15\\books_bom.xml", Encoding.UTF8);

            Assert.Equal(38, fileContent.Length);
            string line1 = fileContent[0].Replace("\ufeff", ""); // remove BOM

            Assert.Equal("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", line1);
            Assert.Equal("  <book category=\"general\">", fileContent[8]);
        }
 private void Load()
 {
     // Utilities.LockPerfTimer l1_clk = Utilities.LockPerfChecker.Start();
     lock (tokens_lock)
     {
         // l1_clk.LockPerfTimerStop();
         try
         {
             if (File.Exists(FILENAME))
             {
                 string[] lines = File.ReadAllLines(FILENAME);
                 foreach (var line in lines)
                 {
                     tokens.Add(line);
                 }
             }
         }
         catch (Exception ex)
         {
             Logging.Warn(ex, "There was a problem loading {0}", FILENAME);
         }
     }
 }
Exemple #10
0
        private void CheckIndexVersion()
        {
            string version = String.Empty;

            try
            {
                if (File.Exists(VersionFilename))
                {
                    string[] index_version_lines = File.ReadAllLines(VersionFilename);
                    version = index_version_lines[0].Trim();
                }
            }
            catch (Exception ex)
            {
                Logging.Error(ex, $"There was a problem while trying to check the index version (path: '{LIBRARY_INDEX_BASE_PATH}')");
            }

            if (0 != String.Compare(version, INDEX_VERSION))
            {
                Logging.Warn("This index is out of date (it's version is {0}), so deleting the index.", version);
                DeleteIndex();
            }
        }
        public static LocaleTable Load(string filename)
        {
            try
            {
                if (File.Exists(filename))
                {
                    LocaleTable locale_table = new LocaleTable();

                    string[] lines = File.ReadAllLines(filename);
                    foreach (string line in lines)
                    {
                        string[] parts = line.Split(LINE_SPLITTER_ARRAY, 2);
                        if (2 == parts.Length)
                        {
                            parts[1] = parts[1].Replace("\\n", Environment.NewLine);
                            locale_table[parts[0]] = String.Format(parts[1]);
                        }
                        else
                        {
                            if (!String.IsNullOrWhiteSpace(line))
                            {
                                Logging.Warn("Ignoring locale line: " + line);
                            }
                        }
                    }

                    return(locale_table);
                }
            }
            catch (Exception ex)
            {
                Logging.Error(ex, "Error loading locale file " + filename);
            }

            return(null);
        }
Exemple #12
0
        private async Task CreateMetaFiles()
        {
            Utils.Log("Getting Nexus API key, please click authorize if a browser window appears");
            var nexusClient = await NexusApiClient.Get();

            var archives = Directory.EnumerateFiles(DownloadsFolder, "*", SearchOption.TopDirectoryOnly).Where(f =>
                                                                                                               File.Exists(f) && Path.GetExtension(f) != Consts.MetaFileExtension && Path.GetExtension(f) != Consts.HashFileExtension &&
                                                                                                               !File.Exists($"{f}.meta") && ActiveArchives.Contains(Path.GetFileNameWithoutExtension(f)));

            await archives.PMap(Queue, async f =>
            {
                Info($"Creating meta file for {Path.GetFileName(f)}");
                var metaString = "[General]\n" +
                                 "repository=Nexus\n" +
                                 $"gameName={GameName}\n";
                string hash;
                using (var md5 = MD5.Create())
                    using (var stream = File.OpenRead(f))
                    {
                        Utils.Log($"Calculating hash for {Path.GetFileName(f)}");
                        var cH = md5.ComputeHash(stream);
                        hash   = BitConverter.ToString(cH).Replace("-", "").ToLowerInvariant();
                        Utils.Log($"Hash is {hash}");
                    }

                var md5Response = await nexusClient.GetModInfoFromMD5(Game, hash);
                if (md5Response.Count >= 1)
                {
                    var modInfo = md5Response[0].mod;
                    metaString += $"modID={modInfo.mod_id}\n" +
                                  $"modName={modInfo.name}\n" +
                                  $"fileID={md5Response[0].file_details.file_id}\n" +
                                  $"version={md5Response[0].file_details.version}\n" +
                                  $"hash={hash}\n";
                    File.WriteAllText(f + Consts.MetaFileExtension, metaString, Encoding.UTF8);
                }
                else
                {
                    Error("Error while getting information from NexusMods via MD5 hash!");
                }
            });

            var otherFiles = Directory.EnumerateFiles(DownloadsFolder, "*", SearchOption.TopDirectoryOnly).Where(f =>
                                                                                                                 Path.GetExtension(f) == Consts.MetaFileExtension && !ActiveArchives.Contains(Path.GetFileNameWithoutExtension(f)));

            await otherFiles.PMap(Queue, async f =>
            {
                Info($"File {f} is not in ActiveArchives");
                var lines = File.ReadAllLines(f);
                if (lines.Length == 0 || !lines.Any(line => lines.Contains("directURL=")))
                {
                    if (lines.Length == 0)
                    {
                        return;
                    }

                    lines.Do(line =>
                    {
                        var tag = "";
                        if (line.Contains("tag="))
                        {
                            tag = line.Substring("tag=".Length);
                        }

                        if (tag != Consts.WABBAJACK_VORTEX_MANUAL)
                        {
                            return;
                        }

                        Info($"File {f} contains the {Consts.WABBAJACK_VORTEX_MANUAL} tag, adding to ActiveArchives");
                        ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
                    });
                }
                else
                {
                    Info($"File {f} appears to not be from the Nexus, adding to ActiveArchives");
                    ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
                }
            });

            Info("Checking for Steam Workshop Items...");
            if (!_isSteamGame || _steamGame == null || !_hasSteamWorkshopItems)
            {
                return;
            }

            _steamGame.WorkshopItems.Do(item =>
            {
                var filePath = Path.Combine(DownloadsFolder, $"steamWorkshopItem_{item.ItemID}.meta");
                if (File.Exists(filePath))
                {
                    Utils.Log($"File {filePath} already exists, skipping");
                    return;
                }

                Utils.Log($"Creating meta file for {item.ItemID}");
                var metaString = "[General]\n" +
                                 "repository=Steam\n" +
                                 $"gameName={GameName}\n" +
                                 $"steamID={_steamGame.ID}\n" +
                                 $"itemID={item.ItemID}\n" +
                                 $"itemSize={item.Size}\n";
                try
                {
                    File.WriteAllText(filePath, metaString);
                }
                catch (Exception e)
                {
                    Utils.Error(e, $"Exception while writing to disk at {filePath}");
                }
            });
        }
Exemple #13
0
        public void Build(ACompiler c, ModList lst)
        {
            MO2Compiler compiler = null;

            if (lst.ModManager == ModManager.MO2)
            {
                compiler = (MO2Compiler)c;
            }

            Text($"### {lst.Name} by {lst.Author} - Installation Summary");
            Text($"Build with Wabbajack Version {lst.WabbajackVersion}");
            Text(lst.Description);
            Text("#### Website:");
            NoWrapText($"[{lst.Website}]({lst.Website})");
            Text($"Mod Manager: {lst.ModManager.ToString()}");

            if (lst.ModManager == ModManager.MO2)
            {
                var readmeFile = Path.Combine(compiler?.MO2ProfileDir, "readme.md");
                if (File.Exists(readmeFile))
                {
                    File.ReadAllLines(readmeFile)
                    .Do(NoWrapText);
                }
            }

            var archiveCount = lst.Archives.Count + lst.Directives.Count(d => d is SteamMeta);
            var totalSize    = lst.Archives.Sum(a => a.Size);

            totalSize += lst.Directives.Where(d => d is SteamMeta).Cast <SteamMeta>().Sum(s => s.Size);

            Text(
                $"#### Download Summary ({archiveCount} archives - {totalSize.ToFileSizeString()})");
            foreach (var archive in SortArchives(lst.Archives))
            {
                var hash = archive.Hash.FromBase64().ToHex();
                NoWrapText(archive.State.GetReportEntry(archive));
                NoWrapText($"    * Size : {archive.Size.ToFileSizeString()}");
                NoWrapText($"    * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})");
            }
            lst.Directives.Where(d => d is SteamMeta).Do(f =>
            {
                if (!(f is SteamMeta s))
                {
                    return;
                }

                var link = $"https://steamcommunity.com/sharedfiles/filedetails/?id={s.ItemID}";
                var size = ((long)s.Size).ToFileSizeString();
                NoWrapText($"* Steam Workshop Item: [{s.ItemID}]({link}) | Size: {size}");
            });

            Text("\n\n");
            var patched = lst.Directives.OfType <PatchedFromArchive>().OrderBy(p => p.To).ToList();

            Text($"#### Summary of ({patched.Count}) patches");
            foreach (var directive in patched)
            {
                NoWrapText(
                    $"* Applying {SizeForID(directive.PatchID)} byte patch `{directive.FullPath}` to create `{directive.To}`");
            }


            var files = lst.Directives.OrderBy(d => d.To).ToList();

            Text($"\n\n### Install Plan of ({files.Count}) files");
            Text("(ignoring files that are directly copied from archives or listed in the patches section above)");
            foreach (var directive in files.OrderBy(f => f.GetType().Name).ThenByDescending(f => f.To))
            {
                switch (directive)
                {
                case PropertyFile i:
                    NoWrapText($"* `{i.SourceDataID}` as a `{Enum.GetName(typeof(PropertyType),i.Type)}`");
                    break;

                case FromArchive f:
                    //NoWrapText($"* `{f.To}` from `{f.FullPath}`");
                    break;

                case CleanedESM i:
                    NoWrapText($"* `{i.To}` by applying a patch to a game ESM ({i.SourceESMHash})");
                    break;

                case RemappedInlineFile i:
                    NoWrapText($"* `{i.To}` by remapping the contents of an inline file");
                    break;

                case InlineFile i:
                    NoWrapText($"* `{i.To}` from `{SizeForID(i.SourceDataID).ToFileSizeString()}` file included in modlist");
                    break;

                case CreateBSA i:
                    NoWrapText(
                        $"* `{i.To}` by creating a BSA of files found in `{Consts.BSACreationDir}\\{i.TempID}`");
                    break;
                }
            }

            var inlined = lst.Directives.OfType <InlineFile>()
                          .Select(f => (f.To, "inlined", SizeForID(f.SourceDataID)))
                          .Concat(lst.Directives
                                  .OfType <PatchedFromArchive>()
                                  .Select(f => (f.To, "patched", SizeForID(f.PatchID))))
                          .Distinct()
                          .OrderByDescending(f => f.Item3);

            NoWrapText("\n\n### Summary of inlined files in this installer");
            foreach (var inline in inlined)
            {
                NoWrapText($"* {inline.Item3.ToFileSizeString()} for {inline.Item2} file {inline.To}");
            }
        }
Exemple #14
0
        public void Build(Compiler c, ModList lst)
        {
            Text($"### {lst.Name} by {lst.Author} - Installation Summary");
            Text(lst.Description);
            Text($"#### Website:");
            NoWrapText($"[{lst.Website}]({lst.Website})");

            var readme_file = Path.Combine(c.MO2ProfileDir, "readme.md");

            if (File.Exists(readme_file))
            {
                File.ReadAllLines(readme_file)
                .Do(NoWrapText);
            }

            Text(
                $"#### Download Summary ({lst.Archives.Count} archives - {lst.Archives.Sum(a => a.Size).ToFileSizeString()})");
            foreach (var archive in SortArchives(lst.Archives))
            {
                var hash = archive.Hash.FromBase64().ToHEX();
                NoWrapText(archive.State.GetReportEntry(archive));
                NoWrapText($"    * Size : {archive.Size.ToFileSizeString()}");
                NoWrapText($"    * SHA256 : [{hash}](https://www.virustotal.com/gui/file/{hash})");
            }

            Text("\n\n");
            var patched = lst.Directives.OfType <PatchedFromArchive>().OrderBy(p => p.To).ToList();

            Text($"#### Summary of ({patched.Count}) patches");
            foreach (var directive in patched)
            {
                NoWrapText(
                    $"* Applying {SizeForID(directive.PatchID)} byte patch `{directive.FullPath}` to create `{directive.To}`");
            }


            var files = lst.Directives.OrderBy(d => d.To).ToList();

            Text($"\n\n### Install Plan of ({files.Count}) files");
            Text("(ignoring files that are directly copied from archives or listed in the patches section above)");
            foreach (var directive in files.OrderBy(f => f.GetType().Name).ThenByDescending(f => f.To))
            {
                switch (directive)
                {
                case PropertyFile i:
                    NoWrapText($"* `{i.SourceDataID}` as a `{Enum.GetName(typeof(PropertyType),i.Type)}`");
                    break;

                case FromArchive f:
                    //NoWrapText($"* `{f.To}` from `{f.FullPath}`");
                    break;

                case CleanedESM i:
                    NoWrapText($"* `{i.To}` by applying a patch to a game ESM ({i.SourceESMHash})");
                    break;

                case RemappedInlineFile i:
                    NoWrapText($"* `{i.To}` by remapping the contents of an inline file");
                    break;

                case InlineFile i:
                    NoWrapText($"* `{i.To}` from `{SizeForID(i.SourceDataID).ToFileSizeString()}` file included in modlist");
                    break;

                case CreateBSA i:
                    NoWrapText(
                        $"* `{i.To}` by creating a BSA of files found in `{Consts.BSACreationDir}\\{i.TempID}`");
                    break;
                }
            }

            var inlined = lst.Directives.OfType <InlineFile>()
                          .Select(f => (f.To, "inlined", SizeForID(f.SourceDataID)))
                          .Concat(lst.Directives
                                  .OfType <PatchedFromArchive>()
                                  .Select(f => (f.To, "patched", SizeForID(f.PatchID))))
                          .ToHashSet()
                          .OrderByDescending(f => f.Item3);

            NoWrapText("\n\n### Summary of inlined files in this installer");
            foreach (var inline in inlined)
            {
                NoWrapText($"* {inline.Item3.ToFileSizeString()} for {inline.Item2} file {inline.To}");
            }
        }
Exemple #15
0
 public override string[] ReadAllLines(string path, Encoding encoding)
 {
     return(AfsFile.ReadAllLines(path, encoding));
 }
Exemple #16
0
 public override string[] ReadAllLines(string path)
 {
     return(AfsFile.ReadAllLines(path));
 }