Make NSIS uninstaller filename (Uninstall.exe) customizable.
When we have to generate two different setup packages from the same project (modules, libraries, data-files, etc...) we want to have opportunity to install/update/delete them independently. But the later installed package would overwrite the 'Uninstall.exe'. This patch fixes the issue by customizing uninstaller name: set (CPACK_UNINSTALL_NAME "My Custom Uninstaller Name") before directive include (CPack).
This commit is contained in:
parent
91d5261b58
commit
8d46d4838b
@ -380,6 +380,7 @@ cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
|
||||
"${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
|
||||
cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
|
||||
cpack_set_if_not_set(CPACK_UNINSTALL_NAME "Uninstall")
|
||||
|
||||
# always force to exactly "true" or "false" for CPack.Info.plist.in:
|
||||
if(CPACK_PACKAGE_RELOCATABLE)
|
||||
|
@ -647,7 +647,7 @@ Section "-Core installation"
|
||||
WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
|
||||
|
||||
;Create uninstaller
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
WriteUninstaller "$INSTDIR\@CPACK_UNINSTALL_NAME@.exe"
|
||||
Push "DisplayName"
|
||||
Push "@CPACK_NSIS_DISPLAY_NAME@"
|
||||
Call ConditionalAddToRegisty
|
||||
@ -658,7 +658,7 @@ Section "-Core installation"
|
||||
Push "@CPACK_PACKAGE_VENDOR@"
|
||||
Call ConditionalAddToRegisty
|
||||
Push "UninstallString"
|
||||
Push "$INSTDIR\Uninstall.exe"
|
||||
Push "$INSTDIR\@CPACK_UNINSTALL_NAME@.exe"
|
||||
Call ConditionalAddToRegisty
|
||||
Push "NoRepair"
|
||||
Push "1"
|
||||
@ -695,7 +695,7 @@ Section "-Core installation"
|
||||
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
|
||||
@CPACK_NSIS_CREATE_ICONS@
|
||||
@CPACK_NSIS_CREATE_ICONS_EXTRA@
|
||||
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@CPACK_UNINSTALL_NAME@.exe"
|
||||
|
||||
;Read a value from an InstallOptions INI file
|
||||
!insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State"
|
||||
@ -834,7 +834,7 @@ Section "Uninstall"
|
||||
!endif
|
||||
|
||||
;Remove the uninstaller itself.
|
||||
Delete "$INSTDIR\Uninstall.exe"
|
||||
Delete "$INSTDIR\@CPACK_UNINSTALL_NAME@.exe"
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
|
||||
|
||||
;Remove the installation directory if it is empty.
|
||||
|
@ -922,7 +922,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(_localtime64_s HAVE__LOCALTIME64_S)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64)
|
||||
#CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64) # Fails on XP SP3
|
||||
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "")
|
||||
CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH)
|
||||
|
Loading…
x
Reference in New Issue
Block a user