Skip to content

Commit

Permalink
refs #5103. Auto NSIS unistall.
Browse files Browse the repository at this point in the history
Quite a pain to get this right. Performs an automatic unistall as part of the setup. Will also now chain through slient mode options through to the internal uninstall command. Also uses wait version of exec to ensure sequential uninstall/install. Works in admin (command line mode) and via the GUI now.
  • Loading branch information
OwenArnold committed Apr 19, 2012
1 parent d49b4a3 commit 529df13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Code/Mantid/Build/CMake/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@

;Set compression
SetCompressor @CPACK_NSIS_COMPRESSOR@

SetOverwrite @CPACK_NSIS_FORCE_OVERWRITE@

@CPACK_NSIS_DEFINES@

Expand Down Expand Up @@ -903,6 +901,13 @@ SectionEnd
; "Program Files" for AllUsers, "My Documents" for JustMe...

Function .onInit

; Silently uninstall any previous install
IfSilent +3
ExecWait '"$INSTDIR\uninstall.exe" _?=$INSTDIR'
Goto +2
ExecWait '"$INSTDIR\uninstall.exe" _?=$INSTDIR /S'

; Reads components status for registry
!insertmacro SectionList "InitSection"

Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Build/CMake/WindowsNSIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
set( CPACK_PACKAGE_NAME "Mantid${CPACK_PACKAGE_SUFFIX}" )
set( CPACK_PACKAGE_INSTALL_DIRECTORY "MantidInstall${CPACK_PACKAGE_SUFFIX}")
set( CPACK_NSIS_INSTALL_ROOT "C:")
set( CPACK_NSIS_FORCE_OVERWRITE on CACHE STRING "Force installer to overwrite any existing install")
set_property(CACHE CPACK_NSIS_FORCE_OVERWRITE PROPERTY STRINGS on off)

#set( CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
set( CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/Images\\\\MantidPlot_Icon_32offset.png" )
Expand Down

0 comments on commit 529df13

Please sign in to comment.