From 35f31a7c1d402c6f0a4c2711b147374b96f146ec Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Sun, 10 Nov 2013 19:09:32 +0100 Subject: [PATCH] win32: Manually generate manifest to indicate Win7 compatibility Telling Windows that we support Windows 7 means it will stop catching unhandled exceptions that occur in a callback from kernel mode, and allow our own crash handler to catch then. --- CMakeLists.txt | 7 +++++++ src/res/engine.rc | 12 ++++++++++++ src/res/openclonk.manifest | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/res/openclonk.manifest diff --git a/CMakeLists.txt b/CMakeLists.txt index e6374c252..fcf529a2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -586,6 +586,8 @@ if(WIN32) src/res/resource.h ) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/res/openclonk.manifest" "${CMAKE_CURRENT_BINARY_DIR}/openclonk.manifest" COPYONLY) + if(MINGW) # cmake does not support compiling resources with MinGW # natively, see http://www.cmake.org/Bug/view.php?id=4068. @@ -1162,6 +1164,11 @@ if(MSVC) oc_set_target_names(c4group) oc_set_target_names(c4script) oc_set_target_names(netpuncher) + + # cmake does not support embedding arbitrary manifests, + # so we add it to the resource file ourselves and tell + # MSVC not to create its own. + set_property(TARGET openclonk APPEND PROPERTY LINK_FLAGS "/MANIFEST:NO") endif() ############################################################################ diff --git a/src/res/engine.rc b/src/res/engine.rc index 4d0d2ec82..5d1493cf3 100644 --- a/src/res/engine.rc +++ b/src/res/engine.rc @@ -8,6 +8,18 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN #pragma code_page(1252) +///////////////////////////////////////////////////////////////////////////// +// +// Manifest +// +#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID +#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 +#endif +#ifndef RT_MANIFEST +#define RT_MANIFEST 24 +#endif +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "openclonk.manifest" + ///////////////////////////////////////////////////////////////////////////// // // Icons diff --git a/src/res/openclonk.manifest b/src/res/openclonk.manifest new file mode 100644 index 000000000..81f660f5a --- /dev/null +++ b/src/res/openclonk.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file