8000 3.8: attempt to first uninstall the old service on silent upgrade as well by KVS85 · Pull Request #14839 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

3.8: attempt to first uninstall the old service on silent upgrade as well #14839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
v3.8.2 (XXXX-XX-XX)
-------------------

* Fixed BTS-582: ArangoDB client EXE package for Windows has incorrect metadata.

* Fixed BTS-575: Windows EXE installer doesn't replace service during upgrade in
silent (non-UI) mode.

* Fix issue #14819: Query: AQL: missing variable # for node #... location
RestCursorHandler.cpp.

Expand Down
39 changes: 33 additions & 6 deletions Installation/Windows/Templates/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ Function check_previous_install
StrCpy $UpgradeInstall "0"
IfFileExists "$DATADIR\@INC_CPACK_ARANGO_DATA_DIR@\SERVER" OldFound
10000 IfFileExists "$DATADIR\@INC_CPACK_ARANGO_DATA_DIR@\ENGINE" OldFound
IfSilent 0 continueNoDirectMatch
IfFileExists "$DATADIR\ENGINE" OldFound
continueNoDirectMatch:
DetailPrint "This is a fresh install."
return
OldFound:
Expand All @@ -238,7 +241,16 @@ Function stop_old_service
SimpleSC::StopService '${TRI_SVC_NAME}' 0 30
Call WaitForServiceDown
SimpleSC::RemoveService '${TRI_SVC_NAME}'
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
IntCmp $0 0 Done_stop_old
IntCmp $0 1060 Done_stop_old ; service not there, we don't care.
Push $0
SimpleSC::GetErrorMessage
Pop $0
DetailPrint 'Stopping ArangoDB fails - Reason: $0'
MessageBox MB_OK 'Stopping ArangoDB fails - Reason: $0'
${EndIf}
Done_stop_old:
FunctionEnd


Expand Down Expand Up @@ -731,7 +743,7 @@ Function UpgradeExisting
push ${ARANGO_EXIT_ALREADY_RUNNING}
pop $0
retryDetectUpgradeNeeded:
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.foreground-tty false --database.check-version" $0
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.foreground-tty false --database.check-version $DATADIR" $0
DetailPrint "done Checking whether an existing database needs upgrade: $0"
${If} $0 == ${ARANGO_EXIT_ALREADY_RUNNING}
${OrIf} $0 == ${ARANGO_EXIT_COULD_NOT_LOCK}
Expand Down Expand Up @@ -759,7 +771,7 @@ retryDetectUpgradeNeeded:
${EndIf}
DetailPrint "Attempting to run database upgrade: "
; Now actually do the upgrade
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.level error --database.auto-upgrade true" $0
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.level error --database.auto-upgrade true $DATADIR" $0
DetailPrint "Done running database upgrade: $0"
${If} $0 != 0
!insertmacro printExitCode $0 "the Upgrade failed, please do a manual upgrade" ""
Expand Down Expand Up @@ -886,6 +898,13 @@ FunctionEnd
;Installer Sections

Section "-Core installation"
IfSilent 0 continueBaseInstall
; this would be called inside the UI code:
Call check_previous_install
${If} $UpgradeInstall == "1"
Call stop_old_service
${EndIf}
continueBaseInstall:
;Use the entire tree produced by the INSTALL target. Keep the
;list of directories here in sync with the RMDir commands below.
SetOutPath "$INSTDIR"
Expand Down Expand Up @@ -970,9 +989,6 @@ Section "-Core installation"
CreateDirectory $LOGDIR
${EndIf}

; non-interactive install only hits us here?
Call check_previous_install

CreateDirectory $APPDIR
Call assignFileRights
${If} $UpgradeInstall == "1"
Expand Down Expand Up @@ -1255,6 +1271,7 @@ SectionEnd
; "Program Files" for AllUsers, "My Documents" for JustMe...

var CMDINSTDIR
var CMDUPGRADE

Function .onInit
; are we allowed to install admin in first place?
Expand Down Expand Up @@ -1292,7 +1309,17 @@ Function .onInit
${EndIf}
noInstDir:

# we only want to manipulate APPDIR here if /APPDIR is really set!
# $AUTOMATIC_UPDATE would be set later in the UI code (if)
StrCpy $AUTOMATIC_UPDATE "0"
${GetParameters} $R0
ClearErrors
${GetOptions} $R0 "/UPGRADE=" $CMDUPGRADE
IfErrors noUpgrade 0
IfSilent 0 noUpgrade
StrCpy $AUTOMATIC_UPDATE "$CMDUPGRADE"
noUpgrade:

# we only want to manipulate APPDIR here if /APPDIR is really set!
${GetParameters} $R0
ClearErrors
${GetOptions} $R0 "/APPDIR=" $CMDINSTDIR
Expand Down
4 changes: 3 additions & 1 deletion cmake/packages/client/nsis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set(ARANGODB_URL_INFO_ABOUT "@ARANGODB_URL_INFO_ABOUT@")
set(ARANGODB_SOURCE_DIR "@ARANGODB_SOURCE_DIR@")
set(ARANGODB_VERSION "@ARANGODB_VERSION@")
set(ARANGODB_PACKAGE_ARCHITECTURE "@ARANGODB_PACKAGE_ARCHITECTURE@")
set(ARANGODB_PACKAGE_VENDOR "@ARANGODB_PACKAGE_VENDOR@")
set(ARANGODB_PACKAGE_CONTACT "@ARANGODB_PACKAGE_CONTACT@")

set(CMAKE_INSTALL_FULL_BINDIR "@CMAKE_INSTALL_FULL_BINDIR@")
Expand Down Expand Up @@ -73,6 +74,7 @@ set(ARANGODB_JS_VERSION "@ARANGODB_JS_VERSION@")
################################################################################

set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
set(CPACK_PACKAGE_VENDOR ${ARANGODB_PACKAGE_VENDOR})
set(CPACK_PACKAGE_CONTACT ${ARANGODB_PACKAGE_CONTACT})

if (${USE_ENTERPRISE})
Expand Down Expand Up @@ -127,7 +129,7 @@ INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT} DESTINATION ${CMAKE_INST
set (ICON_PATH "${W_INSTALL_FILES}/Icons/")
install(DIRECTORY "${ICON_PATH}" DESTINATION "resources")

file(TO_NATIVE_PATH "resources/Icons/arangodb.ico" RELATIVE_ARANGO_ICON)
file(TO_NATIVE_PATH "resources/arangodb.ico" RELATIVE_ARANGO_ICON)
file(TO_NATIVE_PATH "${ICON_PATH}arangodb.bmp" ARANGO_IMG)
file(TO_NATIVE_PATH "${ICON_PATH}/arangodb.ico" ARANGO_ICON)

Expand Down
0