From c1719bc817421e46ba95f8919e3dc2d977ee81af Mon Sep 17 00:00:00 2001 From: alex-z Date: Mon, 4 Mar 2024 19:29:24 +0100 Subject: [PATCH] Allow installation to close shell extension DLLs via the custom action. Disable reboot prompt in case of the version with this change was previously already installed. Signed-off-by: alex-z --- CMakeLists.txt | 5 ++ admin/win/msi/Nextcloud.wxs | 28 ++++++-- admin/win/msi/OEM.wxi.in | 4 ++ admin/win/tools/NCMsiHelper/CustomAction.cpp | 67 +++++++++++++++++ admin/win/tools/NCMsiHelper/CustomAction.def | 1 + admin/win/tools/NCMsiHelper/NCMsiHelper.wxs | 19 +++++ config.h.in | 4 ++ .../windows/NCContextMenu/dllmain.cpp | 66 +++++++++++++++++ .../windows/NCOverlays/DllMain.cpp | 66 +++++++++++++++++ .../windows/WinShellExtConstants.h.in | 3 + src/libsync/vfs/cfapi/shellext/dllmain.cpp | 71 +++++++++++++++++++ 11 files changed, 330 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 687733588..8aae90a42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,13 @@ set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") include(${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake) +set ( NCCONTEXTMENU_SHELLEXT_WINDOW_CLASS_NAME "${APPLICATION_SHORTNAME}_Shxt_CntMenuHndlr_WndClass" ) +set ( NCOVERLAYS_SHELLEXT_WINDOW_CLASS_NAME "${APPLICATION_SHORTNAME}_Shxt_Ovs_WndClass" ) + # CfAPI Shell Extensions set( CFAPI_SHELL_EXTENSIONS_LIB_NAME CfApiShellExtensions ) + +set ( CFAPI_SHELLEXT_WINDOW_CLASS_NAME "${APPLICATION_SHORTNAME}_${CFAPI_SHELL_EXTENSIONS_LIB_NAME}_WndClass" ) set( CFAPI_SHELLEXT_APPID_REG "{E314A650-DCA4-416E-974E-18EA37C213EA}") set( CFAPI_SHELLEXT_APPID_DISPLAY_NAME "${APPLICATION_NAME} CfApi Shell Extensions" ) diff --git a/admin/win/msi/Nextcloud.wxs b/admin/win/msi/Nextcloud.wxs index 374241dae..4719d85dc 100644 --- a/admin/win/msi/Nextcloud.wxs +++ b/admin/win/msi/Nextcloud.wxs @@ -60,18 +60,33 @@ + + + + + + + + + - + + + + + + + NSIS_UNINSTALLEXE AND NOT Installed @@ -80,9 +95,8 @@ (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") - - - (SCHEDULE_REBOOT=1) OR NOT (UILevel=2) + + (SCHEDULE_REBOOT=1) OR ((NOT (UILevel=2)) AND (NOT IS_PREV_VERSION_SHELL_EXT_CLOSE_SUPPORTED)) @@ -184,6 +198,11 @@ + + + + + @@ -213,6 +232,7 @@ + diff --git a/admin/win/msi/OEM.wxi.in b/admin/win/msi/OEM.wxi.in index e35451eef..ae8f964e2 100644 --- a/admin/win/msi/OEM.wxi.in +++ b/admin/win/msi/OEM.wxi.in @@ -31,6 +31,10 @@ + + + +