An NSIS script that builds a Windows installer for the Notepad4 binaries (Notepad4 and matepath), with an option to replace Windows Notepad.
Status: maintained, bumped with each Notepad4 release. Download the installer from Releases.
- Installs Notepad4 and matepath (default folder
C:\Program Files\Notepad4; an update reuses the previous install's folder), with Start menu shortcuts and an Apps & Features entry - Optional: Replace Windows Editor — every
notepad.exelaunch opens Notepad4 (Windows 10/11) - Optional: Fetch latest version (online) — opt-in; queries GitHub for the latest Notepad4 release and installs it instead of the bundled one if its tag differs (see Online update). No internet access happens unless you select this option.
- Silent installation support
The current installer bundles Notepad4 v26.10r6392 (English, x64).
Run the installer. By default only Notepad4 is selected and the bundled version is installed offline. The components page offers three install types:
| Install type | Notepad4 | Replace Windows Editor | Fetch latest version (online) |
|---|---|---|---|
| Minimal (preselected) | ✓ | ||
| Typical | ✓ | ✓ | |
| Full | ✓ | ✓ | ✓ |
notepad4_en_x64_v26.10r6392-install.exe /S /I=full
/S— Silent mode (no GUI)/I=full— also replace Windows Notepad (does not enable the online fetch)/I=minimal— Notepad4 only (the default; any value other thanfullbehaves the same)/UPDATE— enable the online fetch of the latest version (silent mode only)/D=C:\path\to\Notepad4— install folder; must be the last parameter and unquoted, even with spaces. Without it the previous install's folder is used, elseC:\Program Files\Notepad4.
The section registers "<install folder>\Notepad4.exe" /z as the Debugger for notepad.exe
under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options. On Windows 11 it
also removes the Windows Notepad app package (Get-AppxPackage *Microsoft.WindowsNotepad* | Remove-AppxPackage)
and adds the IFEO filter entries.
The Fetch latest version (online) section (or /UPDATE in silent mode) extracts two PowerShell
helpers to the installer's $PLUGINSDIR and runs them. Every file they read and write stays in that
folder: it is new for each run, only administrators can write to it, and the installer deletes it when
it exits. Nothing goes through the user-writable %TEMP%, so the files the installer copies are the ones
whose zip passed the SHA-256 check.
check_update.ps1asks the GitHub API for the latestzufuliu/notepad4release (10 s timeout).- It picks the first asset matching
Notepad4_en_x64_*.zipthat is not anHDbuild. - It writes
TagName,DownloadURL,SHA256(the asset'sdigestfrom the API) andStatus(OK,NoAssetorError) tonotepad4_update.ini.
- It picks the first asset matching
- If the status is
OKand the tag differs fromBUNDLED_VERSION, the installer asks whether to download it (silent mode downloads without asking). download_update.ps1downloads the zip (60 s timeout) toNotepad4_latest.zip.- It rejects (and deletes) the zip unless its SHA-256 equals
SHA256; a missing digest is a rejection too. - It extracts the zip to
Notepad4_latest(moving the contents of a top-level folder up) and copies every*.ini-defaultto*.ini. - It writes
OKorFAILtonotepad4_download_status.txt.
- It rejects (and deletes) the zip unless its SHA-256 equals
- On
OKthe installer copies the downloadedNotepad4.exe,matepath.exe, the three.inifiles andLicense.txtover the bundled ones.- It records the new tag as the version in Apps & Features.
- Otherwise it installs the bundled version (with a message in interactive mode).
The uninstaller removes the Notepad4 files, Start menu shortcuts and registry entries. If Windows Notepad was replaced, it is restored (on Windows 11 the Windows Notepad app package is re-registered).
Compile with NSIS 3 (Windows, or Linux with apt install nsis):
makensis -WX Notepad4_en_x64_v26.10r6392.nsi
This writes notepad4_en_x64_v26.10r6392-install.exe next to the script (git-ignored). The script
includes psexec.nsh (PowerShell exec macros) and embeds the two update helpers and
Notepad4_Installer.ico. CI (ci.yml) compiles it
with warnings as errors on every push and pull request, and runs the E2E suite.
scripts/e2e.sh compiles the installer and a fixture build. In the fixture build the
online fetch asks 127.0.0.1:${PORT_BASE:-8765} instead of the GitHub API. The script then runs these
tests:
- the screenshot tour, as the sweep over every wizard page;
e2e/test-install.ps1:/D=and the previous install folder;e2e/test-silent.ps1: what/Sand/I=install, thatnotepad.exeopens Notepad4 after/I=full, the uninstaller, and quitting the wizard;e2e/test-update.ps1: the online fetch against a local fake of the release API, both silent and in the wizard (its two message boxes, and the component ticked by hand);e2e/test-download.ps1: the SHA-256 check of the download;e2e/test-wizard.ps1: a typed install folder and Start menu folder, "Do not create shortcuts", and Cancel in the uninstaller.
e2e/COVERAGE.md maps every feature to its test.
The tests really install Notepad4, replace Windows Notepad for a while and uninstall again:
- Throwaway machines only: they refuse to start without
E2E_INSTALL=1. - CI: the
e2ejob runs them on windows-2022 and windows-2025, which cover the pre-Windows 11 branch and the Windows 11 branch of the installer. - Locally: on a disposable Windows VM with Git Bash, NSIS and Python on
PATH, runE2E_INSTALL=1 bash scripts/e2e.sh. Output goes to$ARTIFACTS. - Anywhere else the script stops after the two compiles.
The version is part of the script name, the payload folder name and two defines; the installer file name follows from them.
- Download
Notepad4_en_x64_<version>.zip(not theHDbuild) from the Notepad4 releases and check its SHA-256 against the release asset digest. git mv Notepad4_en_x64_<old> Notepad4_en_x64_<new>and replace its six files with the zip's:Notepad4.exe,matepath.exeandLicense.txt;- the
*.ini-defaultfiles renamed to*.ini(Notepad4.ini,matepath.ini,Notepad4 DarkTheme.ini). - Give
License.txta UTF-8 BOM (printf '\xef\xbb\xbf' | cat - License.txt > l && mv l License.txt), otherwise the license page shows©; the screenshot tour checks it. - If the release's file set changed, adjust the
File,CopyFilesandDeletelines in the script.
git mv Notepad4_en_x64_<old>.nsi Notepad4_en_x64_<new>.nsiand update the defines at the top:BUNDLED_VERSIONmust equal the GitHub release tag exactly (e.g.v26.10r6392; the online fetch compares the two),RELEASEVERSIONisen_x64_<tag>.- Replace every
<old>in this README (grep -n <old> README.md): bundled version, silent-install and build output file names, build command,License.txtlink. makensis -WX Notepad4_en_x64_<new>.nsimust pass. The workflows find the script asNotepad4_en_x64_*.nsiand need no change.
All installer and uninstaller pages: docs/screenshots.
The images come from an automated tour: scripts/docs-screenshots.sh compiles
the installer and runs scripts/docs-tour.ps1, which clicks through every page via
UI Automation, checks each page's heading and captures the window. The tour really installs and uninstalls
Notepad4, so it only runs on throwaway Windows machines and refuses to start without DOCS_TOUR_INSTALL=1.
To regenerate: Actions → Docs screenshots → Run workflow, unzip the docs-screenshots artifact into
docs/screenshots/, run oxipng -o 4 --strip safe docs/screenshots/*.png, review the diff and commit.
On a disposable Windows VM with Git Bash and NSIS on PATH: DOCS_TOUR_INSTALL=1 bash scripts/docs-screenshots.sh.
CI runs the same tour as part of the E2E suite on every push (artifacts e2e-windows-*, folder screenshots/).
The installer script is MIT-licensed (LICENSE). Notepad4 and matepath are distributed under
their own license, shown on the installer's first page
(License.txt).



