From 2703640f4e4212b9a6df07e20b25b06a8a5b4f5e Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 18 Oct 2022 11:16:13 +0200 Subject: [PATCH] MEDFile: on Windows - symbolic links need to escalate user privileges - do a copy --- products/medfile.pyconf | 2 +- products/patches/med-4.1.1-symlink-or-copy.patch | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 products/patches/med-4.1.1-symlink-or-copy.patch diff --git a/products/medfile.pyconf b/products/medfile.pyconf index 37c5e07..1ebb4c0 100644 --- a/products/medfile.pyconf +++ b/products/medfile.pyconf @@ -42,7 +42,7 @@ version_4_1_1 : version_4_1_1_win : { compil_script : "medCMake.bat" - patches : ['med-4.1.0_win_3x_files_support.patch'] + patches : ['med-4.1.0_win_3x_files_support.patch', 'med-4.1.1-symlink-or-copy.patch'] } # needed in order to screen with windows version - see below diff --git a/products/patches/med-4.1.1-symlink-or-copy.patch b/products/patches/med-4.1.1-symlink-or-copy.patch new file mode 100644 index 0000000..b0b2f60 --- /dev/null +++ b/products/patches/med-4.1.1-symlink-or-copy.patch @@ -0,0 +1,16 @@ +--- med-4.1.1_ref/tools/mdump/CMakeLists.txt 2019-09-23 19:24:11.000000000 +0200 ++++ med-4.1.1_new/tools/mdump/CMakeLists.txt 2022-10-18 11:12:17.319703000 +0200 +@@ -44,6 +44,10 @@ + CONFIGURE_FILE(xmdump4.in ${PROJECT_BINARY_DIR}/xmdump4 @ONLY) + + INSTALL(PROGRAMS ${PROJECT_BINARY_DIR}/xmdump2 ${PROJECT_BINARY_DIR}/xmdump3 ${PROJECT_BINARY_DIR}/xmdump4 DESTINATION bin) +-INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink mdump4 mdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") +-INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink xmdump4 xmdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") +- ++IF(WIN32) ++ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy mdump4.exe mdump.exe WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") ++ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy xmdump4 xmdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") ++ELSE(WIN32) ++ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink mdump4 mdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") ++ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink xmdump4 xmdump WORKING_DIRECTORY ${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)") ++ENDIF(WIN32) -- 2.39.2