## Building WinMerge Installer

### Needed programs:

- Inno Setup version 5.1.5.
- ISTool recommended - great help managing Inno Setup installer scripts

There is download package called "QuickStart Pack" available in Inno Setup downloads. It contains all needed components in one installer.

### Installer script:

There are two installer script files in `InnoSetup` folder:

- `WinMerge.iss` is script currently used with InnoSetup 5.x.
- `WinMerge Localized.iss` is InnoSetup 4.x script. Its not updated anymore but we keep it available.

### Checklist:

- Installer reads version number from `WinMerge.exe`. So make sure you have version resource correctly set.
  You can use script to set version info into Merge.rc and all language.rc files: just run `Src/SetResourceVersions.bat` - it asks version number to set.
- Installer checks that files listed are present. But some files are included as directory (like `/Manual`) or as filemask (like `*.flt`) so take extra care to make sure all needed files are present in locations shown below.

### Directory structure and files needed:

These files are produced by compiling WinMerge, documentation etc, but that's not subject of this document, refer to readme-developers.html.

Copy or move the files into the following layout:

- `Build/`
  - `MergeRelease/`
    - `Manual/`
      - Copy the entire HTML manual directory to here
    - `ShellExtension.dll`
    - `WinMerge.exe`
  - `MergeUnicodeRelease/`
    - `ShellExtensionU.dll`
    - `WinMergeU.exe`
    - `WinMergeU.exe.Manifest`
- `Docs/`
  - `Users`
    - Copy the entire `Docs/Users` directory to here
- `Filters/`
  - `FileFilter.tmpl`
  - `*.flt`
- `InnoSetup/`
  - Copy the entire InnoSetup source directory to here
- `Src/`
  - `Languages/`
    - `DLL/`
      - `*.lang`

### Running Inno Setup to create installer

`WinMerge.iss` (in `InnoSetup` folder) is script used to create WinMerge installer.

Rest of this section assumes ISTool is used. If not, then refer to InnoSetup manual for creating installer from script.

1. Start ISTool and load `WinMerge.iss`
2. Select "Project->Verify Files..." from ISTool menu to verify all needed files are present and in correct directories. Copy missing files to correct directories before continuing.
3. Select "Project->Compile Setup" from ISTool menu to create installer. This takes a while...

If compile succeeds you have `WinMerge-[version]-Setup.exe` in directory `InnoSetup/Output`.

Test installer!