Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e9833c

Browse files
committed
1) Stop server on upgrade install in the client file section
2) Do not create extension adminpack on the upgradable install (don't have password)3) Separate license text for languages and versions
1 parent244b494 commit0e9833c

File tree

3 files changed

+95
-5
lines changed

3 files changed

+95
-5
lines changed

‎build/helpers/postgres_nsis_installer.cmd

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,28 @@ REM PostgreSQL Section
9393
>>%NSIS_RES_DIR%\postgres.def.nshECHO !addplugindir Plugins
9494

9595
IF"%ARCH%"=="X64" (
96-
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define PG_64bit
96+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define PG_64bit
9797
)
9898

99+
IF"%PRODUCT_NAME%"=="PostgreSQL" (
100+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_ru"license.txt"
101+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_en"license.txt"
102+
GOTO :ENDLIC
103+
)
104+
IF"%PRODUCT_NAME%"=="PostgresPro" (
105+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_ru"license.txt"
106+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_en"license.txt"
107+
GOTO :ENDLIC
108+
)
109+
IF"%PRODUCT_NAME%"=="PostgresProEnterprise" (
110+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_ru"license.txt"
111+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_en"license.txt"
112+
GOTO :ENDLIC
113+
)
114+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_ru"license.txt"
115+
>>%NSIS_RES_DIR%\postgres.def.nshECHO !define myLicenseFile_en"license.txt"
116+
117+
:ENDLIC
99118

100119
CD /D%NSIS_RES_DIR%||GOTO :ERROR
101120
rem Genarate file lists

‎nsis/postgresql.nsi

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ Var effective_cache_size
136136
!define MUI_WELCOMEPAGE_TITLE_3LINES
137137
!define MUI_FINISHPAGE_TITLE_3LINES
138138
!insertmacro MUI_PAGE_WELCOME
139-
!insertmacro MUI_PAGE_LICENSE"License.txt"
139+
; !insertmacro MUI_PAGE_LICENSE "License.txt"
140+
!insertmacro MUI_PAGE_LICENSE $(myLicenseData)
141+
140142

141143
Pagecustom ChecExistInstall;PG_OLD_DIR !="" if exist
142144
!insertmacro MUI_PAGE_COMPONENTS
@@ -183,6 +185,20 @@ Page custom nsDialogOptimization nsDialogsOptimizationPageLeave
183185

184186
!include translates.nsi
185187

188+
!ifndef myLicenseFile_ru
189+
!define myLicenseFile_ru"license.txt"
190+
!endif
191+
!ifndef myLicenseFile_en
192+
!define myLicenseFile_en"license.txt"
193+
!endif
194+
195+
196+
197+
LicenseLangString myLicenseData${LANG_RUSSIAN}${myLicenseFile_ru}
198+
LicenseLangString myLicenseData${LANG_ENGLISH}${myLicenseFile_en}
199+
LicenseData $(myLicenseData)
200+
201+
186202
;--------------------------------
187203
;Installer Sections
188204
Section"Microsoft Visual C++ ${REDIST_YEAR} Redistributable" secMS
@@ -211,6 +227,26 @@ Section $(componentClient) secClient
211227

212228
;MessageBox MB_OK|MB_ICONINFORMATION "pg_old_dir: $PG_OLD_DIR"
213229
;Call ChecExistInstall ;get port number for psql
230+
var/GLOBAL isStopped
231+
StrCpy$isStopped0
232+
233+
234+
${if}$PG_OLD_DIR!=""; exist PG install
235+
MessageBoxMB_YESNO|MB_ICONQUESTION"$(MESS_STOP_SERVER)"IDYES doitStopIDNO noyetStop
236+
noyetStop:
237+
Return
238+
doitStop:
239+
DetailPrint"Stop the server ..."
240+
${if}$OLD_DATA_DIR!=""
241+
nsExec::Exec'"$PG_OLD_DIR\bin\pg_ctl.exe" stop -D "$OLD_DATA_DIR" -m fast -w'
242+
pop$0
243+
DetailPrint"pg_ctl.exe stop return $0"
244+
StrCpy$isStopped1
245+
${endif}
246+
;unregister
247+
${endif}
248+
249+
214250

215251
!include client_list.nsi
216252
;SetOutPath "$INSTDIR\bin"
@@ -275,11 +311,27 @@ Section $(componentClient) secClient
275311

276312
!insertmacro MUI_STARTMENU_WRITE_END
277313

314+
${if}$isStopped=1
315+
;SectionGetFlags ${sec1} $1
316+
; start server
317+
call IsServerSection
318+
pop$0
319+
${if}$0=="0"
320+
DetailPrint"Start server ..."
321+
Sleep1000
322+
nsExec::ExecToStack /TIMEOUT=60000'sc start "$ServiceID_text"'
323+
Sleep5000
324+
StrCpy$isStopped0
325+
${endif}
326+
327+
${endif}
328+
278329
SectionEnd
279330

280331
Section $(componentServer) sec1
281332

282333
${if}$PG_OLD_DIR!=""; exist PG install
334+
${if}$isStopped==0
283335
MessageBoxMB_YESNO|MB_ICONQUESTION"$(MESS_STOP_SERVER)"IDYES doitStopIDNO noyetStop
284336
noyetStop:
285337
Return
@@ -290,6 +342,8 @@ Section $(componentServer) sec1
290342
pop$0
291343
DetailPrint"pg_ctl.exe stop return $0"
292344
${endif}
345+
${endif}
346+
293347
;unregister
294348
DetailPrint"Unregister the service ..."
295349
${if}$OldServiceID_text!=""
@@ -757,8 +811,10 @@ Section $(componentServer) sec1
757811

758812

759813
;check connection to the server
814+
${if}$OLD_DATA_DIR=="";if server war running we do not know password
815+
760816
DetailPrint"Check connection ..."
761-
;Sleep 1000
817+
Sleep1000
762818

763819
FileWrite$LogFile"Check connection ...$\r$\n"
764820
FileWrite$LogFile'"$INSTDIR\bin\psql.exe" -p $TextPort_text -U "$UserName_text" -c "SELECT 1;" postgres$\r$\n'
@@ -787,6 +843,8 @@ Section $(componentServer) sec1
787843
DetailPrint"Checking connection is OK"
788844
FileWrite$LogFile"Checking connection is OK$\r$\n"
789845
${endif}
846+
847+
790848
${if}"$Pass1_text"!=""
791849
StrCpy$R0""
792850
System::Call'Kernel32::SetEnvironmentVariableA(t, t) i("PGPASSWORD", R0).r0'
@@ -824,6 +882,10 @@ Section $(componentServer) sec1
824882
System::Call'Kernel32::SetEnvironmentVariableA(t, t) i("PGPASSWORD", R0).r0'
825883
${endif}
826884
${endif}
885+
886+
${endif}; end: if server war running we do not know password?
887+
888+
827889
${if}$isEnvVar==${BST_CHECKED}
828890
WriteRegExpandStrHKLM"SYSTEM\CurrentControlSet\Control\Session Manager\Environment""PGDATA""$DATA_DIR"
829891
WriteRegExpandStrHKLM"SYSTEM\CurrentControlSet\Control\Session Manager\Environment""PGDATABASE""postgres"
@@ -2220,3 +2282,12 @@ Function checkServiceIsRunning
22202282

22212283
FunctionEnd
22222284

2285+
Function IsServerSection
2286+
SectionGetFlags${sec1}$1
2287+
${if}$1==${SF_SELECTED}
2288+
push"1"
2289+
${else}
2290+
push"0"
2291+
${endif}
2292+
2293+
FunctionEnd

‎nsis/translates.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ LangString PostgreSQLString ${LANG_RUSSIAN} "
3434
LangString SERVER_EXIST_TEXT1${LANG_ENGLISH}"An existing PostgresSQL installation has been found at"
3535
LangString SERVER_EXIST_TEXT1${LANG_RUSSIAN}"Íàéäåíà èíñòàëëÿöèÿ ñåðâåðà PostgresSQL â êàòàëîãå"
3636

37-
LangString SERVER_EXIST_TEXT2${LANG_ENGLISH}"This instalation will be upgraded.$\n$\nIn order to upgrade, we may need to restart the server"
38-
LangString SERVER_EXIST_TEXT2${LANG_RUSSIAN}"Ýòà óñòàíîâêà áóäåò îáíîâëåíà.$\n$\nÄëÿ çàâåðøåíèÿ îáíîâëåíèÿ ìîæåò ïîòðåáîâàòüñÿ ïåðåçàïóñòèòüñåðâåð"
37+
LangString SERVER_EXIST_TEXT2${LANG_ENGLISH}"This instalation will be upgraded.$\n$\nIn order to upgrade, we may need to restart thePostgreSQLserver"
38+
LangString SERVER_EXIST_TEXT2${LANG_RUSSIAN}"Ýòà óñòàíîâêà áóäåò îáíîâëåíà.$\n$\nÄëÿ çàâåðøåíèÿ îáíîâëåíèÿ ìîæåò ïîòðåáîâàòüñÿ ïåðåçàïóñòèòüPostgreSQL ñåðâåð"
3939

4040
LangString DATADIR_EXIST_TITLE${LANG_ENGLISH}"Existing data directory"
4141
LangString DATADIR_EXIST_TITLE${LANG_RUSSIAN}"Óæå èìååòñÿ êàòàëîã ñ äàííûìè"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp