Decrease size of ScintillaNET DLL (original) (raw)
This repository was archived by the owner on Dec 22, 2023. It is now read-only.
This repository was archived by the owner on Dec 22, 2023. It is now read-only.
Description
Compressing the SciLexer DLLs using gzip will decrease their size by about half and hence reduce the size of the final DLL. Implementing this requires gzipped files to be embedded and a minor change to the code, line 862 in Scintilla.cs:GetModulePath()
var resource = string.Format(CultureInfo.InvariantCulture, "ScintillaNET.{0}.SciLexer.dll.gz", (IntPtr.Size == 4 ? "x86" : "x64"));
var resourceStream = typeof(Scintilla).Assembly.GetManifestResourceStream(resource); // Don't close the resource stream
using (var gzipStream = new System.IO.Compression.GZipStream(resourceStream, System.IO.Compression.CompressionMode.Decompress))
using (var fileStream = File.Create(modulePath))
gzipStream.CopyTo(fileStream);