1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Windows: inhibit all default application manifests.

In 0.81 and before, we put an application manifest (XML-formatted
Windows resource) into all the GUI tools on purpose, and the CLI tools
like Plink didn't have one. But in 0.82, the CLI tools do have one,
and it's a small default one we didn't write ourselves, inserted by
some combination of cmake and clang-imitating-MSVC (I haven't checked
which of those is the cause).

This appears to have happened as a side effect of a build-tools
update, not on purpose. And its effect is that Windows XP now objects
to our plink.exe, because it's very picky about manifest format (we
have an old 'xp-wont-run' bug record about that).

Since it seemed to work fine to not have a manifest at all in 0.81,
let's go back to that. We were already passing /manifest:no to inhibit
the default manifest in the GUI tools, to stop it fighting with our
custom one; now I've moved /manifest:no into the global linker flags,
so it's applied to _all_ binaries, whether we're putting our own
manifest in or not.
This commit is contained in:
Simon Tatham 2024-12-16 18:44:47 +00:00
parent 363debc7f0
commit 27550b02e2
2 changed files with 6 additions and 18 deletions

View File

@ -101,14 +101,12 @@ endif()
if(WINELIB) if(WINELIB)
enable_language(RC) enable_language(RC)
set(LFLAG_MANIFEST_NO "")
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC" OR
CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC") CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /nologo /C1252") set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /nologo /C1252")
set(LFLAG_MANIFEST_NO "/manifest:no") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /manifest:no")
else() else()
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -c1252") set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -c1252")
set(LFLAG_MANIFEST_NO "")
endif() endif()
if(STRICT) if(STRICT)

View File

@ -83,9 +83,7 @@ add_dependencies(pageant generated_licence_h)
target_link_libraries(pageant target_link_libraries(pageant
guimisc eventloop agent network crypto utils guimisc eventloop agent network crypto utils
${platform_libraries}) ${platform_libraries})
set_target_properties(pageant PROPERTIES set_target_properties(pageant PROPERTIES WIN32_EXECUTABLE ON)
WIN32_EXECUTABLE ON
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
installed_program(pageant) installed_program(pageant)
add_sources_from_current_dir(plink no-jump-list.c nohelp.c plink.rc) add_sources_from_current_dir(plink no-jump-list.c nohelp.c plink.rc)
@ -111,9 +109,7 @@ target_link_libraries(putty
guiterminal guimisc eventloop sshclient otherbackends settings network crypto guiterminal guimisc eventloop sshclient otherbackends settings network crypto
utils utils
${platform_libraries}) ${platform_libraries})
set_target_properties(putty PROPERTIES set_target_properties(putty PROPERTIES WIN32_EXECUTABLE ON)
WIN32_EXECUTABLE ON
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
installed_program(putty) installed_program(putty)
add_executable(puttytel add_executable(puttytel
@ -132,9 +128,7 @@ add_dependencies(puttytel generated_licence_h)
target_link_libraries(puttytel target_link_libraries(puttytel
guiterminal guimisc eventloop otherbackends settings network utils guiterminal guimisc eventloop otherbackends settings network utils
${platform_libraries}) ${platform_libraries})
set_target_properties(puttytel PROPERTIES set_target_properties(puttytel PROPERTIES WIN32_EXECUTABLE ON)
WIN32_EXECUTABLE ON
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
installed_program(puttytel) installed_program(puttytel)
add_executable(puttygen add_executable(puttygen
@ -152,9 +146,7 @@ add_dependencies(puttygen generated_licence_h)
target_link_libraries(puttygen target_link_libraries(puttygen
keygen guimisc crypto utils keygen guimisc crypto utils
${platform_libraries}) ${platform_libraries})
set_target_properties(puttygen PROPERTIES set_target_properties(puttygen PROPERTIES WIN32_EXECUTABLE ON)
WIN32_EXECUTABLE ON
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
installed_program(puttygen) installed_program(puttygen)
if(HAVE_CONPTY) if(HAVE_CONPTY)
@ -174,9 +166,7 @@ if(HAVE_CONPTY)
target_link_libraries(pterm target_link_libraries(pterm
guiterminal guimisc eventloop settings network utils guiterminal guimisc eventloop settings network utils
${platform_libraries}) ${platform_libraries})
set_target_properties(pterm PROPERTIES set_target_properties(pterm PROPERTIES WIN32_EXECUTABLE ON)
WIN32_EXECUTABLE ON
LINK_FLAGS "${LFLAG_MANIFEST_NO}")
installed_program(pterm) installed_program(pterm)
else() else()
message("ConPTY not available; cannot build Windows pterm") message("ConPTY not available; cannot build Windows pterm")