Skip to content

Commit 29b2685

Browse files
committed
PostgresPro 9.5.3.1
1 parent 11f673c commit 29b2685

File tree

10 files changed

+70
-22
lines changed

10 files changed

+70
-22
lines changed

build/helpers/dependencies.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cp -va *.exe %DEPENDENCIES_BIN_DIR%\less
3333
:BUILD_WINLIBEDIT
3434
TITLE Build winlibedit
3535
CD /D %DOWNLOADS_DIR%
36-
wget --no-check-certificate -c http://netcologne.dl.sourceforge.net/project/mingweditline/wineditline-%EDITLINE_VER%.zip
36+
wget --no-check-certificate -c http://downloads.dl.sourceforge.net/project/mingweditline/wineditline-%EDITLINE_VER%.zip
3737

3838
CD /D %DEPENDENCIES_SRC_DIR%
3939
7z x %DOWNLOADS_DIR%\wineditline-%EDITLINE_VER%.zip

build/helpers/pgadmin.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ IF %SDK% == MSVC2015 (
6060
cp -va %DEPENDENCIES_SRC_DIR%/wxWidgets-3*/lib %DEPENDENCIES_BIN_DIR%\wxwidgets || GOTO :ERROR
6161
cp -va %DEPENDENCIES_SRC_DIR%/wxWidgets-3*/utils %DEPENDENCIES_BIN_DIR%\wxwidgets || GOTO :ERROR
6262
IF %ARCH% == X64 (
63-
mv -v %DEPENDENCIES_BIN_DIR%/wxwidgets/lib/vc_*dll %DEPENDENCIES_BIN_DIR%\wxwidgets\lib\vc_dll || GOTO :ERROR
64-
mv -v %DEPENDENCIES_BIN_DIR%/wxwidgets/lib/vc_*lib %DEPENDENCIES_BIN_DIR%\wxwidgets\lib\vc_lib || GOTO :ERROR
63+
rem mv -v %DEPENDENCIES_BIN_DIR%/wxwidgets/lib/vc_*dll %DEPENDENCIES_BIN_DIR%\wxwidgets\lib\vc_dll || GOTO :ERROR
64+
rem mv -v %DEPENDENCIES_BIN_DIR%/wxwidgets/lib/vc_*_lib/* %DEPENDENCIES_BIN_DIR%\wxwidgets\lib\vc_lib || GOTO :ERROR
6565
)
6666
cp -va %DEPENDENCIES_SRC_DIR%/wxWidgets-3*/include %DEPENDENCIES_BIN_DIR%\wxwidgets\include || GOTO :ERROR
6767

build/helpers/postgres.cmd

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ MKDIR %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql
8585
CD %BUILD_DIR%\postgresql\*%PGVER%*\src\tools\msvc
8686

8787

88+
8889
rem We need ICONV and LibIntl DLLS available during install for ZIC to work
8990
rem no need to copy them, just add to PATH
9091
PATH %PATH%;%DEPENDENCIES_BIN_DIR%\libintl\lib;%DEPENDENCIES_BIN_DIR%\iconv\lib
@@ -111,9 +112,25 @@ cp -va %DEPENDENCIES_BIN_DIR%/openssl/include/* %BUILD_DIR%\distr_%ARCH%_%PGVER
111112
cp -va %DEPENDENCIES_BIN_DIR%/zlib/include/* %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\include || GOTO :ERROR
112113
cp -va %DEPENDENCIES_BIN_DIR%/uuid/include/* %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\include || GOTO :ERROR
113114

114-
CD %BUILD_DIR%\postgresql\*%PGVER%*\doc\src\sgml
115-
cp -va html/* %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\doc
116-
115+
rem Copy msys shell and sed
116+
CD %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\bin
117+
7z x %DOWNLOADS_DIR%\min_msys_%ARCH%.zip
118+
rem CD %BUILD_DIR%\postgresql\*%PGVER%*\doc\src\sgml
119+
rem cp -va html/* %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\doc
120+
rem building help files
121+
CD %BUILD_DIR%\postgresql
122+
mkdir help-ru
123+
mkdir help-en
124+
CD help-ru
125+
7z x %DOWNLOADS_DIR%\help-sources-ru.zip
126+
CD help-ru
127+
"C:\Program Files (x86)\HTML Help Workshop\hhc" htmlhelp.hhp
128+
cp htmlhelp.chm %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\doc\postgresql-ru.chm
129+
CD ..\help-en
130+
7z x %DOWNLOADS_DIR%\help-sources-en.zip
131+
CD help-en
132+
"C:\Program Files (x86)\HTML Help Workshop\hhc" htmlhelp.hhp
133+
cp htmlhelp.chm %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql\doc\postgresql-en.chm
117134
7z a -r %DOWNLOADS_DIR%\pgsql_%ARCH%_%PGVER%.zip %BUILD_DIR%\distr_%ARCH%_%PGVER%\postgresql
118135

119136
GOTO :DONE
@@ -125,4 +142,3 @@ EXIT /b %errorlevel%
125142

126143
:DONE
127144
ECHO Done.
128-
PAUSE

build/helpers/postgres_installer.cmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ GOTO :DONE
3636

3737
:ERROR
3838
ECHO Failed with error #%errorlevel%.
39-
PAUSE
4039
EXIT /b %errorlevel%
4140

4241
:DONE
4342
ECHO Done.
44-
PAUSE

build/helpers/postgres_nsis_installer.cmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ IF %ONE_C% == YES (
2121
SET PRODUCT_DIR_REGKEY="Software\Postgres Professional\${PRODUCT_NAME}\${PRODUCT_VERSION}"
2222
SET PRODUCT_VERSION="%PG_MAJOR_VERSION%"
2323
) ELSE (
24-
SET PRODUCT_NAME=PostgreSQL
24+
SET PRODUCT_NAME=PostgresPro
2525
SET PG_DEF_SERVICEID="postgresql-%ARCH%-%PG_MAJOR_VERSION%"
2626
SET PG_INS_SUFFIX="%ARCH%bit_Setup.exe"
2727
SET PG_REG_KEY="SOFTWARE\%COMPANY_NAME%\%ARCH%\%PRODUCT_NAME%\%PG_MAJOR_VERSION%\Installations\postgresql-%PG_MAJOR_VERSION%"
@@ -58,6 +58,8 @@ REM PostgreSQL Section
5858
>>%NSIS_RES_DIR%\postgres.def.nsh ECHO !define PG_INS_SUFFIX %PG_INS_SUFFIX%
5959
>>%NSIS_RES_DIR%\postgres.def.nsh ECHO !define PG_INS_SOURCE_DIR %PG_INS_SOURCE_DIR%
6060
>>%NSIS_RES_DIR%\postgres.def.nsh ECHO !define REDIST_YEAR %REDIST_YEAR%
61+
>>%NSIS_RES_DIR%\postgres.def.nsh ECHO !addplugindir Plugins
62+
6163
IF "%ARCH%" == "X64" (
6264
>>%NSIS_RES_DIR%\postgres.def.nsh ECHO !define PG_64bit
6365
)
@@ -75,4 +77,3 @@ EXIT /b %errorlevel%
7577

7678
:DONE
7779
ECHO Done.
78-
PAUSE

build/helpers/setvars.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SET ICONV_VER=1.14
33
SET XSLT_VER=1.1.28
44
SET ZLIB_VER=1.2.8
55
SET XML_VER=2.7.3
6-
SET OPENSSL_VER=1.0.2g
6+
SET OPENSSL_VER=1.0.2h
77
SET GETTEXT_VER=0.19.4
88
SET LIBSSH2_VER=1.6.0
99
SET WXWIDGETS_VER=3.0.2

build/run.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ IF DEFINED USG (
3535

3636
REM Set PostgreSQL version
3737
IF "%PG_MAJOR_VERSION%"=="" SET PG_MAJOR_VERSION=9.5
38-
IF "%PG_PATCH_VERSION%"=="" SET PG_PATCH_VERSION=1
38+
IF "%PG_PATCH_VERSION%"=="" SET PG_PATCH_VERSION=3.1
3939

4040
REM Set PgAdmin3 Version
4141
SET PGADMIN_VERSION=1.22.1

nsis/Plugins/nsisFirewall.dll

8 KB
Binary file not shown.

nsis/pgadmin.nsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ Var StartMenuFolder
8484
;--------------------------------
8585
;Installer Sections
8686

87-
Section "Microsoft Visual C++ 2015 Redistibutable" secMS
87+
Section "Microsoft Visual C++ $REDIST_YEAR Redistibutable" secMS
8888
GetTempFileName $1
8989
!ifdef PG_64bit
90-
File /oname=$1 "c:\pg\vcredist\vcredist_x64_2015.exe"
90+
File /oname=$1 "c:\pg\vcredist\vcredist_x64_${REDIST_YEAR}.exe"
9191
!else
92-
File /oname=$1 "c:\pg\vcredist\vcredist_x86_2015.exe"
92+
File /oname=$1 "c:\pg\vcredist\vcredist_x86_${REDIST_YEAR}.exe"
9393
!endif
9494
ExecWait "$1 /passive /norestart" $0
9595
DetailPrint "Visual C++ Redistributable Packages return $0"

nsis/postgresql.nsi

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
; used plugins: AccessControl, UserMgr,
44
; and AddToPath plugin was created by Victor Spirin for this project
55

6+
!addplugindir Plugins
67
!include "postgres.def.nsh"
78

89
;--------------------------------
@@ -189,7 +190,7 @@ Section $(PostgreSQLString) sec1
189190
;unregister
190191
DetailPrint "Unregister the service ..."
191192
${if} $ServiceID_text != ""
192-
nsExec::Exec '"$INSTDIR\bin\pg_ctl.exe" unregister -N "$ServiceID_text"'
193+
nsExec::Exec '"$INSTDIR\bin\pg_ctl.exe" unregister -N "$ServiceID_text"'
193194
pop $0
194195
DetailPrint "pg_ctl.exe unregister return $0"
195196
${endif}
@@ -237,7 +238,9 @@ Section $(PostgreSQLString) sec1
237238
ClearErrors
238239
FileOpen $0 $INSTDIR\scripts\runpgsql.bat w
239240
IfErrors creatBatErr2
240-
FileWrite $0 '@echo off$\r$\nPATH $INSTDIR\bin;%PATH%$\r$\npsql.exe -h localhost -U "$UserName_text" -d postgres -p $TextPort_text $\r$\npause'
241+
System::Call "kernel32::GetACP() i .r2"
242+
DetailPrint "ANSI code page $2"
243+
FileWrite $0 '@echo off$\r$\nchcp $2$\r$\nPATH $INSTDIR\bin;%PATH%$\r$\npsql.exe -h localhost -U "$UserName_text" -d postgres -p $TextPort_text $\r$\npause'
241244
FileClose $0
242245

243246
creatBatErr2:
@@ -262,6 +265,13 @@ Section $(PostgreSQLString) sec1
262265
FileClose $0
263266

264267
creatBatErr5:
268+
ClearErrors
269+
FileOpen $0 $INSTDIR\scripts\pgpro_upgrade.cmd w
270+
IfErrors creatBatErr6
271+
FileWrite $0 '@echo off$\r$\nset dd=%1$\r\$\nset PGDATA=%dd:"=%$\r$\nPATH $INSTDIR\bin;%PATH%$\r$\nsh.exe "$INSTDIR\bin\pgpro_upgrade"$\r$\n'
272+
FileClose $0
273+
274+
creatBatErr6:
265275
;for all users
266276
SetShellVarContext all
267277
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
@@ -319,8 +329,13 @@ Section $(PostgreSQLString) sec1
319329
"$INSTDIR\doc\pg-help.ico" "0"
320330

321331
!insertmacro CreateInternetShortcut \
322-
"$SMPROGRAMS\$StartMenuFolder\Documentation\PostgreSQL documentation" \
323-
"$INSTDIR\doc\postgresql\html\index.html" \
332+
"$SMPROGRAMS\$StartMenuFolder\Documentation\PostgreSQL documentation (EN)" \
333+
"$INSTDIR\doc\postgresql-en.chm" \
334+
"$INSTDIR\doc\pg-help.ico" "0"
335+
336+
!insertmacro CreateInternetShortcut \
337+
"$SMPROGRAMS\$StartMenuFolder\Documentation\PostgreSQL documentation (RU)" \
338+
"$INSTDIR\doc\postgresql-ru.chm" \
324339
"$INSTDIR\doc\pg-help.ico" "0"
325340

326341
!insertmacro CreateInternetShortcut \
@@ -329,7 +344,6 @@ Section $(PostgreSQLString) sec1
329344
"$INSTDIR\doc\pg-help.ico" "0"
330345

331346
!insertmacro MUI_STARTMENU_WRITE_END
332-
333347
; Create data dir begin
334348
${if} $isDataDirExist == 0
335349
CreateDirectory "$DATA_DIR"
@@ -365,6 +379,7 @@ Section $(PostgreSQLString) sec1
365379
${else}
366380
nsExec::ExecToStack /TIMEOUT=60000 '"$INSTDIR\bin\initdb.exe" $tempVar \
367381
--locale="$Locale_text" \
382+
--encoding=$Coding_text \
368383
-U "$UserName_text" \
369384
-D "$DATA_DIR"'
370385
${endif}
@@ -389,6 +404,14 @@ Section $(PostgreSQLString) sec1
389404
${if} $isDataDirExist == 0
390405
${if} $checkNoLocal_state == ${BST_CHECKED}
391406
!insertmacro _ReplaceInFile "$DATA_DIR\postgresql.conf" "#listen_addresses = 'localhost'" "listen_addresses = '*'"
407+
; Add line to pg_hba.conf
408+
FileOpen $4 "$DATA_DIR\pg_hba.conf" a
409+
FileSeek $4 0 END
410+
FileWrite $4 "host$\tall$\tall$\t0.0.0.0/0$\tmd5$\r$\n"
411+
FileClose $4
412+
; Add postgres to Windows Firewall exceptions
413+
nsisFirewall::AddAuthorizedApplication "$INSTDIR\bin\postgres.exe" "PostgresPro server"
414+
pop $0
392415
${else}
393416
!insertmacro _ReplaceInFile "$DATA_DIR\postgresql.conf" "#listen_addresses = 'localhost'" "listen_addresses = 'localhost'"
394417
${EndIf}
@@ -407,7 +430,7 @@ Section $(PostgreSQLString) sec1
407430
${endif}
408431
${endif}
409432
${EndIf}
410-
433+
;# Add line to pg_hba.conf
411434
Call WriteInstallOptions
412435
DetailPrint "Service $ServiceID_text registration ..."
413436
nsExec::ExecToStack /TIMEOUT=60000 '"$INSTDIR\bin\pg_ctl.exe" register -N "$ServiceID_text" -U "$ServiceAccount_text" -D "$DATA_DIR" -w'
@@ -445,6 +468,15 @@ Section $(PostgreSQLString) sec1
445468

446469
AccessControl::GrantOnFile "$INSTDIR\scripts" "$loggedInUser" "FullAccess"
447470
Pop $0 ;"ok" or "error" + error details
471+
${if} $isDataDirExist == 1
472+
; there exist data directory. We need to stop service,
473+
; run pgpro-upgrade script and
474+
DetailPrint "Performing catalog upgradeon $DATA_DIR"
475+
nsExec::ExecToStack '"$INSTDIR/scripts/pgpro_upgrade" "$DATA_DIR"'
476+
pop $0
477+
Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
478+
DetailPrint "$1"
479+
${endif}
448480

449481
DetailPrint "Start server service..."
450482
Sleep 1000
@@ -493,6 +525,7 @@ Section $(PostgreSQLString) sec1
493525
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PGUSER" "$UserName_text"
494526
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PGPORT" "$TextPort_text"
495527
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PGLOCALEDIR" "$INSTDIR\share\locale\"
528+
AddToPath::AddToPath "$INSTDIR\bin"
496529
${endif}
497530
SectionEnd
498531

0 commit comments

Comments
 (0)