--- source_files: - DataPRO/InstallShieldBranch/Brancher.cs - DataPRO/InstallShieldBranch/BrancherForm.Designer.cs - DataPRO/InstallShieldBranch/BrancherForm.cs generated_at: "2026-04-17T16:11:52.545850+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "5517450301a3034c" --- # InstallShieldBranch ### 1. Purpose This module is a utility application designed to perform binary search-and-replace operations on InstallShield project files (`.ise`). It exists to automate the patching of version identifiers or internal codes within proprietary binary file formats, likely to facilitate branching or versioning of installer configurations. ### 2. Public Interface **Class: `Brancher`** (static, in `Brancher.cs`) * `static void Main(string[] args)`: Application entry point. Initializes visual styles and launches `BrancherForm`. **Class: `BrancherForm`** (in `BrancherForm.cs`) * `public BrancherForm()`: Constructor initializing a `BackgroundWorker` configured to report progress and support cancellation. * `public static class BinaryUtility`: A nested utility class for stream manipulation. * `public static IEnumerable GetByteStream(BinaryReader reader)`: Lazily reads bytes from a `BinaryReader` in 1024-byte chunks. * `public static void Replace(BinaryReader reader, BinaryWriter writer, IEnumerable> searchAndReplace)`: Reads a stream, performs replacements, and writes to the output stream. * `public static IEnumerable Replace(IEnumerable source, IEnumerable> searchAndReplace)`: Applies multiple search/replace patterns to a byte stream. * `public static IEnumerable Replace(IEnumerable input, IEnumerable from, IEnumerable to)`: Core logic that replaces occurrences of a specific byte sequence (`from`) with another (`to`). ###