Exemple #1
0
        public void Patch(string outFile)
        {
            if (_merged.Entries.Count == 0)
            {
                return;
            }

            _logger.Info("Patching Win32 resources");

            var ms = new MemoryStream();

            using (var f = File.Open(outFile, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                f.CopyTo(ms);
            }
            ms.Position = 0;


            var reader = new ImageReader(ms);

            using (var file = File.Open(outFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
            {
                var writer = new ImageWriter(reader, file);
                writer.Prepare(_merged);
                writer.Write();
            }
        }