8000 attempt to first uninstall the old service on silent upgrade as well … · arangodb/arangodb@9206515 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 9206515

Browse files
KVS85dothebart
andauthored
attempt to first uninstall the old service on silent upgrade as well (#14731) (#14839)
* attempt to first uninstall the old service on silent upgrade as well, so the new one can be installed afterwards without problems. * fix syntax * fix non-ui hooks * fix silent upgrade process * fix syntax * skip expected error sitiuation from user interaction * forward package vendor * fix installed icon path * Update CHANGELOG * Update CHANGELOG * Update CHANGELOG Co-authored-by: Vadim Kondratyev <vadim@arangodb.com> Co-authored-by: Wilfried Goesgens <willi@arangodb.com>
1 parent 71ec78d commit 9206515

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
v3.8.2 (XXXX-XX-XX)
22
-------------------
33

4+
* Fixed BTS-582: ArangoDB client EXE package for Windows has incorrect metadata.
5+
6+
* Fixed BTS-575: Windows EXE installer doesn't replace service during upgrade in
7+
silent (non-UI) mode.
8+
49
* Fix issue #14819: Query: AQL: missing variable # for node #... location
510
RestCursorHandler.cpp.
611

Installation/Windows/Templates/NSIS.template.in

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ Function check_previous_install
226226
StrCpy $UpgradeInstall "0"
227227
IfFileExists "$DATADIR\@INC_CPACK_ARANGO_DATA_DIR@\SERVER" OldFound
228228
IfFileExists "$DATADIR\@INC_CPACK_ARANGO_DATA_DIR@\ENGINE" OldFound
229+
IfSilent 0 continueNoDirectMatch
230+
IfFileExists "$DATADIR\ENGINE" OldFound
231+
continueNoDirectMatch:
229232
DetailPrint "This is a fresh install."
230233
return
231234
OldFound:
@@ -238,7 +241,16 @@ Function stop_old_service
238241
SimpleSC::StopService '${TRI_SVC_NAME}' 0 30
239242
Call WaitForServiceDown
240243
SimpleSC::RemoveService '${TRI_SVC_NAME}'
244+
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
245+
IntCmp $0 0 Done_stop_old
246+
IntCmp $0 1060 Done_stop_old ; service not there, we don't care.
247+
Push $0
248+
SimpleSC::GetErrorMessage
249+
Pop $0
250+
DetailPrint 'Stopping ArangoDB fails - Reason: $0'
251+
MessageBox MB_OK 'Stopping ArangoDB fails - Reason: $0'
241252
${EndIf}
253+
Done_stop_old:
242254
FunctionEnd
243255

244256

@@ -731,7 +743,7 @@ Function UpgradeExisting
731743
push ${ARANGO_EXIT_ALREADY_RUNNING}
732744
pop $0
733745
retryDetectUpgradeNeeded:
734-
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.foreground-tty false --database.check-version" $0
746+
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.foreground-tty false --database.check-version $DATADIR" $0
735747
DetailPrint "done Checking whether an existing database needs upgrade: $0"
736748
${If} $0 == ${ARANGO_EXIT_ALREADY_RUNNING}
737749
${OrIf} $0 == ${ARANGO_EXIT_COULD_NOT_LOCK}
@@ -759,7 +771,7 @@ retryDetectUpgradeNeeded:
759771
${EndIf}
760772
DetailPrint "Attempting to run database upgrade: "
761773
; Now actually do the upgrade
762-
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.level error --database.auto-upgrade true" $0
774+
ExecWait "$INSTDIR\${SBIN_DIR}\arangod.exe --server.rest-server false --log.level error --database.auto-upgrade true $DATADIR" $0
763775
DetailPrint "Done running database upgrade: $0"
764776
${If} $0 != 0
765777
!insertmacro printExitCode $0 "the Upgrade failed, please do a manual upgrade" ""
@@ -886,6 +898,13 @@ FunctionEnd
886898
;Installer Sections
887899

888900
Section "-Core installation"
901+
IfSilent 0 continueBaseInstall
902+
; this would be called inside the UI code:
903+
Call check_previous_install
904+
${If} $UpgradeInstall == "1"
905+
Call stop_old_service
906+
${EndIf}
907+
continueBaseInstall:
889908
;Use the entire tree produced by the INSTALL target. Keep the
890909
;list of directories here in sync with the RMDir commands below.
891910
SetOutPath "$INSTDIR"
@@ -970,9 +989,6 @@ Section "-Core installation"
970989
CreateDirectory $LOGDIR
971990
${EndIf}
972991

973-
; non-interactive install only hits us here?
974-
Call check_previous_install
975-
976992
CreateDirectory $APPDIR
977993
Call assignFileRights
978994
${If} $UpgradeInstall == "1"
@@ -1255,6 +1271,7 @@ SectionEnd
12551271
; "Program Files" for AllUsers, "My Documents" for JustMe...
12561272

12571273
var CMDINSTDIR
1274+
var CMDUPGRADE
12581275

12591276
Function .onInit
12601277
; are we allowed to install admin in first place?
@@ -1292,7 +1309,17 @@ Function .onInit
12921309
${EndIf}
12931310
noInstDir:
12941311

1295-
# we only want to manipulate APPDIR here if /APPDIR is really set!
1312+
# $AUTOMATIC_UPDATE would be set later in the UI code (if)
1313+
StrCpy $AUTOMATIC_UPDATE "0"
1314+
${GetParameters} $R0
1315+
ClearErrors
1316+
${GetOptions} $R0 "/UPGRADE=" $CMDUPGRADE
1317+
IfErrors noUpgrade 0
1318+
IfSilent 0 noUpgrade
1319+
StrCpy $AUTOMATIC_UPDATE "$CMDUPGRADE"
1320+
noUpgrade:
1321+
1322+
# we only want to manipulate APPDIR here if /APPDIR is really set!
12961323
${GetParameters} $R0
12971324
ClearErrors
12981325
${GetOptions} $R0 "/APPDIR=" $CMDINSTDIR

cmake/packages/client/nsis.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ set(ARANGODB_URL_INFO_ABOUT "@ARANGODB_URL_INFO_ABOUT@")
3838
set(ARANGODB_SOURCE_DIR "@ARANGODB_SOURCE_DIR@")
3939
set(ARANGODB_VERSION "@ARANGODB_VERSION@")
4040
set(ARANGODB_PACKAGE_ARCHITECTURE "@ARANGODB_PACKAGE_ARCHITECTURE@")
41+
set(ARANGODB_PACKAGE_VENDOR "@ARANGODB_PACKAGE_VENDOR@")
4142
set(ARANGODB_PACKAGE_CONTACT "@ARANGODB_PACKAGE_CONTACT@")
4243

4344
set(CMAKE_INSTALL_FULL_BINDIR "@CMAKE_INSTALL_FULL_BINDIR@")
@@ -73,6 +74,7 @@ set(ARANGODB_JS_VERSION "@ARANGODB_JS_VERSION@")
7374
################################################################################
7475

7576
set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
77+
set(CPACK_PACKAGE_VENDOR ${ARANGODB_PACKAGE_VENDOR})
7678
set(CPACK_PACKAGE_CONTACT ${ARANGODB_PACKAGE_CONTACT})
7779

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

130-
file(TO_NATIVE_PATH "resources/Icons/arangodb.ico" RELATIVE_ARANGO_ICON)
132+
file(TO_NATIVE_PATH "resources/arangodb.ico" RELATIVE_ARANGO_ICON)
131133
file(TO_NATIVE_PATH "${ICON_PATH}arangodb.bmp" ARANGO_IMG)
132134
file(TO_NATIVE_PATH "${ICON_PATH}/arangodb.ico" ARANGO_ICON)
133135

0 commit comments

Comments
 (0)
0