This is a modified version of PuTTY from Simon Tatham to be used with mRemoteNG.
| Branch | Build |
|---|---|
master |
Prebuilt binaries are published on the Releases page,
alongside a SHA256SUMS.txt you can check the download against:
Get-FileHash .\PuTTYNG-<version>-x64.exe -Algorithm SHA256Each release also carries PuTTY-LICENCE.txt. See Licence below.
Upstream PuTTY is not vendored into this repository. The build clones it fresh and applies the mRemoteNG changes as patches, so there is very little to keep in sync here.
Requirements
- Visual Studio 2017 or later with the Desktop development with C++ workload
(any edition, including the free Build Tools). It is found automatically via
vswhere. - Git.
CMake and Ninja come from the Visual Studio install, so no separate CMake is needed.
Run it
.\PuTTYNG.ps1Output lands in putty\Release\PuTTYNG.exe.
| Parameter | Purpose |
|---|---|
-PuttyRef |
Upstream tag/branch/commit to build, e.g. 0.84. Pin this for a reproducible build. |
-SkipClone |
Reuse the existing .\putty folder instead of deleting and re-cloning it. |
-Configuration |
CMake configuration. Defaults to Release. |
-OutputName |
Name for the built exe. Defaults to PuTTYNG.exe. |
Note that without -SkipClone the .\putty folder is deleted and re-cloned, so any local
edits in it are lost.
- Clones https://git.tartarus.org/simon/putty.git.
- Applies every patch in
patches/withgit apply --3way. - Stamps the mRemoteNG version strings into
version.h, derived from the upstream tag. - Builds the
puttytarget with/DPUTTYNGdefined.
The clone is deliberately not shallow: git describe needs the tag history for step 3, and
git apply --3way needs the pre-image blobs to fall back to a three-way merge when upstream
has moved. A full clone takes about 15 seconds.
Files changed in the PuTTY tree:
| File | How | What |
|---|---|---|
cmdline.c |
patch | Adds the -hwndparent and -auth-plugin / -auth_plugin options. |
putty.h |
patch | Declares the pointer-safe hwnd_parent handle and forces IsZoomed() true so the embedded window behaves as maximised. |
windows/window.c |
patch | Creates the terminal as a normal top-level window, then reparents it under hwnd_parent with SetParent/SetWindowLongPtr (a window cannot be created with WS_CHILD set directly, since CreateWindowEx requires a real parent HWND at creation time); writes errors into the terminal instead of a modal MessageBox, which would otherwise block an embedded session. |
.gitignore |
patch | Ignores the in-source CMake build output. |
version.h |
script | Version strings, derived from the upstream tag at build time. |
All the C changes sit behind #ifdef PUTTYNG, so a build without that define produces stock
PuTTY. See patches/README.md for how to refresh a patch after an
upstream release.
PuTTY is MIT licensed, copyright Simon Tatham and contributors. The MIT licence requires the
copyright and permission notice to accompany every copy of the software, so releases ship
PuTTY-LICENCE.txt (the upstream LICENCE file, verbatim) next to the executable. Keep the two
together if you redistribute the binary.
When building locally the same text is at putty\LICENCE in the cloned tree.