Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions PuTTYNG.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ if (Test-Path -LiteralPath $workFolder) {
(Get-Content $workFile).Replace('-Unidentified-Local-Build', '-Release-mRemoteNG-Build') | Set-Content $workFile
(Get-Content $workFile).Replace('0,0,0,0', $setNewVersion) | Set-Content $workFile
Write-Host "Code block replaced successfully in '$workFile'."

# Fix InternalName: PuTTY uses APPNAME macro for InternalName in the .rc resource.
# Patch version.h to define a custom APPNAME so the compiled exe reports "PuTTYNG"
# instead of "PuTTY". This is needed for mRemoteNG's PuttyTypeDetector to identify
# the embedded PuTTYNG and enable -hwndparent (embedded window mode).
$versionContent = Get-Content $workFile -Raw
if ($versionContent -notmatch 'PUTTYNG_APPNAME') {
Add-Content $workFile "`n/* Override InternalName for mRemoteNG detection */`n#define APPNAME `"PuTTYNG`"`n"
Write-Host "Added APPNAME override to '$workFile'."
}
#===================================================================================================

#Add mRemoteNG required changes
Expand Down