@@ -220,7 +220,7 @@ Section $(PostgreSQLString) sec1
220
220
File " License.txt"
221
221
File " 3rd_party_licenses.txt"
222
222
223
- FileOpen $LogFile $INSTDIR \install.log w ; Opens a Empty File an fills it
223
+ FileOpen $LogFile $INSTDIR \install.log w ; Opens a Empty File an fills it
224
224
225
225
226
226
CreateDirectory " $INSTDIR\scripts"
@@ -231,12 +231,12 @@ FileOpen $LogFile $INSTDIR\install.log w ;Opens a Empty File an fills it
231
231
WriteRegStr HKLM " ${PRODUCT_DIR_REGKEY}" " " $INSTDIR
232
232
233
233
; Create uninstaller
234
- FileWrite $LogFile " Create uninstaller$\r$\n "
234
+ FileWrite $LogFile " Create uninstaller$\r$\n "
235
235
236
236
WriteUninstaller " $INSTDIR\Uninstall.exe"
237
237
238
238
; write uninstall strings
239
- FileWrite $LogFile " Write to register\r$\n "
239
+ FileWrite $LogFile " Write to register\r$\n "
240
240
241
241
WriteRegExpandStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${PG_DEF_BRANDING}" " InstallLocation" " $INSTDIR"
242
242
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${PG_DEF_BRANDING}" " DisplayName" " $StartMenuFolder"
@@ -251,7 +251,7 @@ FileWrite $LogFile "Write to register\r$\n"
251
251
IntFmt $0 " 0x%08X" $0
252
252
WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${PG_DEF_BRANDING}" " EstimatedSize" " $0"
253
253
254
- FileWrite $LogFile " Create BAT files$\r$\n "
254
+ FileWrite $LogFile " Create BAT files$\r$\n "
255
255
ClearErrors
256
256
FileOpen $0 $INSTDIR \scripts\reload.bat w
257
257
IfErrors creatBatErr
@@ -321,7 +321,7 @@ FileWrite $LogFile "Create BAT files$\r$\n"
321
321
SetShellVarContext all
322
322
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
323
323
324
- FileWrite $LogFile " Create shortcuts$\r$\n "
324
+ FileWrite $LogFile " Create shortcuts$\r$\n "
325
325
326
326
; Create shortcuts
327
327
CreateDirectory " $SMPROGRAMS\$StartMenuFolder"
@@ -334,7 +334,7 @@ FileWrite $LogFile "Create shortcuts$\r$\n"
334
334
${endif}
335
335
336
336
; set font Lucida Console for shortcut psql
337
- FileWrite $LogFile " set font Lucida Console for shortcut psql$\r$\n "
337
+ FileWrite $LogFile " set font Lucida Console for shortcut psql$\r$\n "
338
338
ReadRegStr $0 HKCU " Console\SQL Shell (psql)" " FaceName"
339
339
${if} $0 == " "
340
340
WriteRegStr HKCU " Console\SQL Shell (psql)" " FaceName" " Consolas"
@@ -378,14 +378,14 @@ FileWrite $LogFile "set font Lucida Console for shortcut psql$\r$\n"
378
378
379
379
!insertmacro MUI_STARTMENU_WRITE_END
380
380
; Create data dir begin
381
- FileWrite $LogFile " Create data dir begin$\r$\n "
381
+ FileWrite $LogFile " Create data dir begin$\r$\n "
382
382
383
383
${if} $isDataDirExist == 0
384
384
CreateDirectory " $DATA_DIR"
385
385
; AccessControl::GrantOnFile "$DATA_DIR" "(BU)" "FullAccess" ;GenericWrite
386
386
; Pop $0 ;"ok" or "error" + error details
387
387
388
- FileWrite $LogFile " GRANT Access $\r$\n "
388
+ FileWrite $LogFile " GRANT Access $\r$\n "
389
389
390
390
DetailPrint " GRANT FullAccess ON $DATA_DIR TO $loggedInUser"
391
391
AccessControl::GrantOnFile " $DATA_DIR" " $loggedInUser" " FullAccess" ; GenericWrite
@@ -409,18 +409,19 @@ FileWrite $LogFile "GRANT Access $\r$\n"
409
409
AccessControl::GrantOnFile " $DATA_DIR" " $0" " FullAccess" ; GenericWrite
410
410
Pop $0 ; "ok" or "error" + error details
411
411
System::Call ' Kernel32::SetEnvironmentVariable(t, t)i ("LC_MESSAGES", "C").r0'
412
- FileWrite $LogFile " Database initialization ...$\r$\n "
412
+
413
+ FileWrite $LogFile " Database initialization ...$\r$\n "
413
414
414
415
${if} " $Locale_text" == " $(DEF_LOCALE_NAME)"
415
- FileWrite $LogFile ' "$INSTDIR\bin\initdb.exe" $tempVar \
416
+ FileWrite $LogFile ' "$INSTDIR\bin\initdb.exe" $tempVar \
416
417
--encoding=$Coding_text -U "$UserName_text" \
417
418
-D "$DATA_DIR" $\r$\n '
418
419
; Initialise the database cluster, and set the appropriate permissions/ownership
419
420
nsExec::ExecToLog /TIMEOUT= 90000 ' "$INSTDIR\bin\initdb.exe" $tempVar \
420
421
--encoding=$Coding_text -U "$UserName_text" \
421
422
-D "$DATA_DIR"'
422
423
${else}
423
- FileWrite $LogFile ' "$INSTDIR\bin\initdb.exe" $tempVar \
424
+ FileWrite $LogFile ' "$INSTDIR\bin\initdb.exe" $tempVar \
424
425
--locale="$Locale_text" \
425
426
--encoding=$Coding_text \
426
427
-U "$UserName_text" \
@@ -437,16 +438,16 @@ FileWrite $LogFile '"$INSTDIR\bin\initdb.exe" $tempVar \
437
438
${if} $0 != 0
438
439
DetailPrint " initdb.exe return $0"
439
440
DetailPrint " Output: $1"
440
- FileWrite $LogFile " initdb.exe return $0 $\r$\n "
441
- FileWrite $LogFile " Output: $1 $\r$\n "
442
- FileClose $LogFile ; Closes the filled file
441
+ FileWrite $LogFile " initdb.exe return $0 $\r$\n "
442
+ FileWrite $LogFile " Output: $1 $\r$\n "
443
+ FileClose $LogFile ; Closes the filled file
443
444
444
445
MessageBox MB_OK |MB_ICONINFORMATION $(MESS_ERROR_INITDB)
445
446
446
447
Abort
447
448
${else}
448
449
DetailPrint " Database initialization OK"
449
- FileWrite $LogFile " Database initialization OK $\r$\n "
450
+ FileWrite $LogFile " Database initialization OK $\r$\n "
450
451
${endif}
451
452
; Delete the password file
452
453
${if} " $Pass1_text" != " "
@@ -456,7 +457,7 @@ FileWrite $LogFile "Database initialization OK $\r$\n"
456
457
${EndIf}
457
458
${endif}
458
459
; Create data dir end
459
- FileWrite $LogFile " Create postgresql.conf $\r$\n "
460
+ FileWrite $LogFile " Create postgresql.conf $\r$\n "
460
461
${if} $isDataDirExist == 0
461
462
${if} $checkNoLocal_state == ${BST_CHECKED}
462
463
!insertmacro _ReplaceInFile " $DATA_DIR\postgresql.conf" " #listen_addresses = 'localhost'" " listen_addresses = '*'"
@@ -521,21 +522,16 @@ FileWrite $LogFile "Create postgresql.conf $\r$\n"
521
522
FileClose $0
522
523
523
524
ErrFileCfg1:
524
- /* shared_preload_libraries = 'online_analyze, plantuner'
525
- online_analyze.table_type = 'temporary'
526
- online_analyze.verbose = 'off'
527
- online_analyze.local_tracking = 'on'
528
- plantuner.fix_empty_table = 'on'
529
- online_analyze.enable = off */
525
+
530
526
${endif}
531
527
${EndIf}
532
528
Delete " $DATA_DIR\postgresql.conf.old"
533
529
534
530
; # Add line to pg_hba.conf
535
531
Call WriteInstallOptions
536
532
DetailPrint " Service $ServiceID_text registration ..."
537
- FileWrite $LogFile " Service $ServiceID_text registration ... $\r$\n "
538
- FileWrite $LogFile ' "$INSTDIR\bin\pg_ctl.exe" register -N "$ServiceID_text" -U "$ServiceAccount_text" -D "$DATA_DIR" -w $\r$\n '
533
+ FileWrite $LogFile " Service $ServiceID_text registration ... $\r$\n "
534
+ FileWrite $LogFile ' "$INSTDIR\bin\pg_ctl.exe" register -N "$ServiceID_text" -U "$ServiceAccount_text" -D "$DATA_DIR" -w $\r$\n '
539
535
540
536
nsExec::ExecToStack /TIMEOUT= 60000 ' "$INSTDIR\bin\pg_ctl.exe" register -N "$ServiceID_text" -U "$ServiceAccount_text" -D "$DATA_DIR" -w'
541
537
Pop $0 # return value/error/timeout
@@ -544,13 +540,13 @@ FileWrite $LogFile '"$INSTDIR\bin\pg_ctl.exe" register -N "$ServiceID_text" -U "
544
540
${if} $0 != 0
545
541
DetailPrint " pg_ctl.exe register return $0"
546
542
DetailPrint " Output: $1"
547
- FileWrite $LogFile " pg_ctl.exe register return $0 $\r$\n "
548
- FileWrite $LogFile " Output: $1 $\r$\n "
543
+ FileWrite $LogFile " pg_ctl.exe register return $0 $\r$\n "
544
+ FileWrite $LogFile " Output: $1 $\r$\n "
549
545
550
546
Sleep 5000
551
547
${else}
552
548
DetailPrint " Service registration OK"
553
- FileWrite $LogFile " Service registration OK $\r$\n "
549
+ FileWrite $LogFile " Service registration OK $\r$\n "
554
550
${endif}
555
551
556
552
; Write the DisplayName manually
@@ -608,8 +604,8 @@ FileWrite $LogFile "Service registration OK $\r$\n"
608
604
${endif}
609
605
610
606
DetailPrint " Start server service..."
611
- FileWrite $LogFile " Start server service... $\r$\n "
612
- FileWrite $LogFile ' sc start "$ServiceID_text" $\r$\n '
607
+ FileWrite $LogFile " Start server service... $\r$\n "
608
+ FileWrite $LogFile ' sc start "$ServiceID_text" $\r$\n '
613
609
614
610
Sleep 1000
615
611
@@ -621,12 +617,12 @@ FileWrite $LogFile 'sc start "$ServiceID_text" $\r$\n'
621
617
${if} $0 != 0
622
618
DetailPrint " Start service return $0"
623
619
DetailPrint " Output: $1"
624
- FileWrite $LogFile " Start service return $0 $\r$\n "
625
- FileWrite $LogFile " Output: $1 $\r$\n "
620
+ FileWrite $LogFile " Start service return $0 $\r$\n "
621
+ FileWrite $LogFile " Output: $1 $\r$\n "
626
622
Sleep 5000
627
623
${else}
628
624
DetailPrint " Start service OK"
629
- FileWrite $LogFile " Start service OK $\r$\n "
625
+ FileWrite $LogFile " Start service OK $\r$\n "
630
626
631
627
${endif}
632
628
@@ -638,23 +634,23 @@ FileWrite $LogFile "Start service OK $\r$\n"
638
634
${endif}
639
635
640
636
DetailPrint " Create adminpack ..."
641
- FileWrite $LogFile " Create adminpack ... $\r$\n "
642
- FileWrite $LogFile ' "$INSTDIR\bin\psql.exe" -p $TextPort_text -U "$UserName_text" -c "CREATE EXTENSION adminpack;" postgres $\r$\n '
637
+ FileWrite $LogFile " Create adminpack ... $\r$\n "
638
+ FileWrite $LogFile ' "$INSTDIR\bin\psql.exe" -p $TextPort_text -U "$UserName_text" -c "CREATE EXTENSION adminpack;" postgres $\r$\n '
643
639
Sleep 5000
644
640
nsExec::ExecToStack /TIMEOUT= 60000 ' "$INSTDIR\bin\psql.exe" -p $TextPort_text -U "$UserName_text" -c "CREATE EXTENSION adminpack;" postgres'
645
641
pop $0
646
642
Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
647
643
${if} $0 != 0
648
644
DetailPrint " Create adminpack return $0"
649
645
DetailPrint " Output: $1"
650
- FileWrite $LogFile " Create adminpack return $0 $\r$\n "
651
- FileWrite $LogFile " Output: $1 $\r$\n "
646
+ FileWrite $LogFile " Create adminpack return $0 $\r$\n "
647
+ FileWrite $LogFile " Output: $1 $\r$\n "
652
648
653
649
; MessageBox MB_OK "Create adminpack error: $1"
654
650
MessageBox MB_OK |MB_ICONSTOP " $(MESS_ERROR_SERVER)"
655
651
${else}
656
652
DetailPrint " Create adminpack OK"
657
- FileWrite $LogFile " Create adminpack OK $\r$\n "
653
+ FileWrite $LogFile " Create adminpack OK $\r$\n "
658
654
${endif}
659
655
${if} " $Pass1_text" != " "
660
656
StrCpy $R0 " "
@@ -669,7 +665,7 @@ FileWrite $LogFile "Create adminpack OK $\r$\n"
669
665
WriteRegExpandStr HKLM " SYSTEM\CurrentControlSet\Control\Session Manager\Environment" " PGLOCALEDIR" " $INSTDIR\share\locale\"
670
666
AddToPath::AddToPath " $INSTDIR\bin"
671
667
${endif}
672
- FileClose $LogFile ; Closes the filled file
668
+ FileClose $LogFile ; Closes the filled file
673
669
674
670
SectionEnd
675
671
0 commit comments