Skip to content

Commit cbc31cf

Browse files
committed
Fixing Qt 5.4 static debug build, terminating 64-bit process on uninstallation
1 parent c7966c7 commit cbc31cf

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ if(BUILD_STATIC)
5656
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
5757
get_filename_component(QT_LIB_DIR ${QtCore_LOCATION} PATH)
5858

59-
find_library(HARFBUZZ qtharfbuzzng ${QT_LIB_DIR})
60-
mark_as_advanced(HARFBUZZ)
61-
target_link_libraries(MouseSim Qt5::OpenGL OpenGL32 ${HARFBUZZ} imm32 winmm ws2_32)
59+
target_link_libraries(MouseSim Qt5::OpenGL OpenGL32 imm32 winmm ws2_32)
6260

61+
find_library(HARFBUZZ qtharfbuzzng ${QT_LIB_DIR})
6362
find_library(PLATFORM_SUPPORT Qt5PlatformSupport ${QT_LIB_DIR})
6463
find_library(WIN_PLATFORM qwindows ${QT_LIB_DIR}/../plugins/platforms/)
65-
mark_as_advanced(PLATFORM_SUPPORT WIN_PLATFORM)
66-
target_link_libraries(MouseSim optimized ${PLATFORM_SUPPORT} optimized ${WIN_PLATFORM})
64+
mark_as_advanced(HARFBUZZ PLATFORM_SUPPORT WIN_PLATFORM)
65+
target_link_libraries(MouseSim optimized ${HARFBUZZ} optimized ${PLATFORM_SUPPORT} optimized ${WIN_PLATFORM})
6766

67+
find_library(HARFBUZZ_D qtharfbuzzngd ${QT_LIB_DIR})
6868
find_library(PLATFORM_SUPPORT_D Qt5PlatformSupportd ${QT_LIB_DIR})
6969
find_library(WIN_PLATFORM_D qwindowsd ${QT_LIB_DIR}/../plugins/platforms/)
70-
mark_as_advanced(PLATFORM_SUPPORT_D WIN_PLATFORM_D)
71-
if(NOT ${PLATFORM_SUPPORT_D} STREQUAL "PLATFORM_SUPPORT_D-NOTFOUND" AND NOT ${WIN_PLATFORM_D} STREQUAL "WIN_PLATFORM_D-NOTFOUND")
72-
target_link_libraries(MouseSim debug ${PLATFORM_SUPPORT_D} debug ${WIN_PLATFORM_D})
70+
mark_as_advanced(HARFBUZZ_D PLATFORM_SUPPORT_D WIN_PLATFORM_D)
71+
if(NOT ${HARFBUZZ_D} STREQUAL "HARFBUZZ_D-NOTFOUND" AND NOT ${PLATFORM_SUPPORT_D} STREQUAL "PLATFORM_SUPPORT_D-NOTFOUND" AND NOT ${WIN_PLATFORM_D} STREQUAL "WIN_PLATFORM_D-NOTFOUND")
72+
target_link_libraries(MouseSim debug ${HARFBUZZ_D} debug ${PLATFORM_SUPPORT_D} debug ${WIN_PLATFORM_D})
7373
else()
7474
set(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "Build Configuration" FORCE)
7575
endif()

NSIS.template.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ FunctionEnd
589589
@CPACK_NSIS_PAGE_COMPONENTS@
590590

591591
!insertmacro MUI_PAGE_INSTFILES
592-
!define MUI_FINISHPAGE_RUN "$INSTDIR\MouseSim.exe"
592+
!define MUI_FINISHPAGE_RUN "$INSTDIR\@CPACK_NSIS_PACKAGE_NAME@.exe"
593593
!insertmacro MUI_PAGE_FINISH
594594

595595
!insertmacro MUI_UNPAGE_CONFIRM
@@ -840,6 +840,8 @@ FunctionEnd
840840
;Uninstaller Section
841841

842842
Section "Uninstall"
843+
KillProcWMI::KillProc "@[email protected]"
844+
843845
ReadRegStr $START_MENU SHCTX \
844846
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "StartMenu"
845847
;MessageBox MB_OK "Start menu is in: $START_MENU"

0 commit comments

Comments
 (0)