10000 fix creating of logfiles (#10708) · nginxpre/arangodb@8c3a1ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 8c3a1ea

Browse files
dothebartjsteemann
authored andcommitted
fix creating of logfiles (arangodb#10708)
1 parent da2007c commit 8c3a1ea

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

Installation/Windows/Templates/NSIS.template.in

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ Var ServiceUp ; did the service start?
7575

7676
Var DATADIR
7777
Var APPDIR
78-
; Var LOGFILE
78+
Var LOGDIR
7979

8080
Var ini_DATADIR
8181
Var ini_APPDIR
82-
; Var ini_LOGFILE
82+
Var ini_LOGFILE
8383

8484
Var UpgradeInstall
8585
Var LaunchAfterInstall
@@ -92,7 +92,7 @@ Var Dlg1_RB_all_users
9292
Var Dlg1_RB_cur_user
9393

9494
Var Dlg1_CB_custom_path
95-
;Var Dlg1_CB_custom_logging
95+
Var Dlg1_CB_custom_logging
9696
Var Dlg1_CB_automatic_update
9797
Var Dlg1_CB_keep_backup
9898
Var Dlg1_CB_add_path
@@ -537,8 +537,9 @@ continueUI:
537537
${NSD_CreateCheckBox} 0 -100 100% 6% "Choose custom install paths for databases and installation"
538538
Pop $Dlg1_CB_custom_path
539539

540-
;${NSD_CreateCheckBox} 0 -120 100% 6% "Enable ArangoDBs own logfiles"
541-
;Pop $Dlg1_CB_custom_logging
540+
${NSD_CreateCheckBox} 0 -120 100% 6% "Enable ArangoDB's own logfiles"
541+
Pop $Dlg1_CB_custom_logging
542+
${NSD_SetState} $Dlg1_CB_custom_logging ${BST_CHECKED}
542543

543544
${NSD_CreateCheckBox} 0 -80 100% 6% "Automatically update existing ArangoDB database"
544545
Pop $Dlg1_CB_automatic_update
@@ -595,10 +596,10 @@ continueUI:
595596
StrCpy $ChooseInstallPath "0"
596597
${EndIf}
597598

598-
;${NSD_GetState} $Dlg1_CB_custom_logging $R0
599-
;${If} $R0 = ${BST_CHECKED}
600-
; StrCpy $LOGFILE "$APPDIR\LOG.txt"
601-
;${EndIf}
599+
${NSD_GetState} $Dlg1_CB_custom_logging $R0
600+
${If} $R0 = ${BST_CHECKED}
601+
StrCpy $LOGDIR "$LOCALAPPDATA\Arangodb-logs\"
602+
${EndIf}
602603

603604

604605
${NSD_GetState} $Dlg1_CB_automatic_update $R0
@@ -948,10 +949,10 @@ Section "-Core installation"
948949
${If} $APPDIR != ""
949950
StrCpy $ini_APPDIR "[javascript]$\r$\napp-path = $APPDIR$\r$\n"
950951
${EndIf}
951-
;${If} $LOGFILE != ""
952-
; StrCpy $ini_LOGFILE "[log]$\r$\nfile = $LOGFILE$\r$\n"
953-
;${EndIf}
954-
StrCpy $newCfgValues "$ini_APPDIR$ini_DATADIR[server]$\r$\nstorage-engine = $STORAGE_ENGINE$\r$\n"
952+
${If} $LOGDIR != ""
953+
StrCpy $ini_LOGFILE "[log]$\r$\nfile = $LOGDIR\arangod.log$\r$\n"
954+
${EndIf}
955+
StrCpy $newCfgValues "$ini_APPDIR$ini_DATADIR$ini_LOGFILE[server]$\r$\nstorage-engine = $STORAGE_ENGINE$\r$\n"
955956
${AnsiToUtf8} $newCfgValues $newCfgValuesUtf8
956957
StrCpy $newCfgValuesFile "$INSTDIR\etc\arangodb3\newValues.ini"
957958
FileOpen $4 "$newCfgValuesFile" w
@@ -963,6 +964,9 @@ Section "-Core installation"
963964
call ReadINIFileKeys
964965
Delete "$newCfgValuesFile"
965966

967+
${If} $LOGDIR != ""
968+
CreateDirectory $LOGDIR
969+
${EndIf}
966970
CreateDirectory $APPDIR
967971
Call assignFileRights
968972
${If} $UpgradeInstall == "1"

0 commit comments

Comments
 (0)
0