Skip to content

Commit 9527e72

Browse files
committed
Does not select a language for install if current Windows ANSI code page is not 1251
1 parent ce6205f commit 9527e72

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

nsis/postgresql.nsi

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
!include "StrContains.nsh"
2727
!insertmacro VersionCompare
2828
;--------------------------------
29+
!define LANGFILE_LANGDLL_FMT "%ENGNAME%"
2930
;General
3031
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
3132
OutFile "${BUILD_DIR}\installers\${PRODUCT_NAME}_${PG_DEF_VERSION}_${PG_INS_SUFFIX}"
@@ -2105,6 +2106,16 @@ Function SetDefaultTcpPort
21052106
${endwhile}
21062107
FunctionEnd
21072108

2109+
!macro GetUIId UN
2110+
Function ${UN}GetUIId
2111+
System::Call 'kernel32::GetACP() i.r10'
2112+
Push $R0
2113+
FunctionEnd
2114+
!macroend
2115+
!insertmacro GetUIId ""
2116+
!insertmacro GetUIId "un."
2117+
2118+
21082119
Function .onInit
21092120
Call CheckWindowsVersion
21102121
Call SetDefaultTcpPort
@@ -2118,8 +2129,18 @@ ${EndIf}
21182129
IntOp $3 ${SF_SELECTED} | ${SF_RO}
21192130
SectionSetFlags ${secClient} $3
21202131
;SectionSetFlags ${secClient} ${SF_RO}
2121-
!define MUI_LANGDLL_ALLLANGUAGES
2122-
!insertmacro MUI_LANGDLL_DISPLAY ;select language
2132+
; !define MUI_LANGDLL_ALLLANGUAGES
2133+
; !insertmacro MUI_LANGDLL_DISPLAY ;select language
2134+
Call GetUIId
2135+
pop $R0
2136+
${if} $R0 == "1251"
2137+
!define MUI_LANGDLL_ALLLANGUAGES
2138+
!insertmacro MUI_LANGDLL_DISPLAY ;select language
2139+
${else}
2140+
StrCpy $LANGUAGE ${LANG_ENGLISH}
2141+
${endif}
2142+
2143+
21232144
StrCpy $PG_OLD_DIR ""
21242145
StrCpy $DATA_DIR "$INSTDIR\data"
21252146
StrCpy $OLD_DATA_DIR ""
@@ -2420,4 +2441,17 @@ Function nsDialogsMorePageLeave
24202441
${endif}
24212442

24222443

2423-
FunctionEnd
2444+
FunctionEnd
2445+
2446+
Function un.onInit
2447+
Call un.GetUIId
2448+
pop $R0
2449+
${if} $R0 == "1251"
2450+
;!define MUI_LANGDLL_ALLLANGUAGES
2451+
!insertmacro MUI_LANGDLL_DISPLAY ;select language
2452+
${else}
2453+
StrCpy $LANGUAGE ${LANG_ENGLISH}
2454+
2455+
${endif}
2456+
2457+
FunctionEnd

0 commit comments

Comments
 (0)