Installer: Reset to English instead of Arabic with an invalid language ID

This commit is contained in:
Birunthan Mohanathas 2013-10-17 09:32:53 +03:00
parent d087a7db42
commit 1940b7f97c
2 changed files with 11 additions and 3 deletions

View File

@ -101,12 +101,14 @@ for /f "tokens=1,2,3 delims=," %%a in (..\Language\List) do (
> "..\Language\Language.rc" echo #include "%%a.h" > "..\Language\Language.rc" echo #include "%%a.h"
>>"..\Language\Language.rc" echo #include "Resource.rc" >>"..\Language\Language.rc" echo #include "Resource.rc"
>>".\Installer\Languages.nsh" echo ${IncludeLanguage} "%%b" "%%a" >>".\Installer\Languages.nsh" echo ${IncludeLanguage} "%%b" "%%a"
set LANGUAGES='%%a - ${LANGFILE_%%b_NAME}' '${LANG_%%b}' '${LANG_%%b_CP}' !LANGUAGES! set LANGDLL_PARAMS='%%a - ${LANGFILE_%%b_NAME}' '${LANG_%%b}' '${LANG_%%b_CP}' !LANGDLL_PARAMS!
set LANGUAGE_IDS=${LANG_%%b},!LANGUAGE_IDS!
%MSBUILD% /t:Language /p:Configuration=Release;Platform=Win32;TargetName=%%c /v:q ..\Rainmeter.sln > "BuildLog.txt" %MSBUILD% /t:Language /p:Configuration=Release;Platform=Win32;TargetName=%%c /v:q ..\Rainmeter.sln > "BuildLog.txt"
if not %ERRORLEVEL% == 0 echo ERROR: Building language %%a failed & goto END if not %ERRORLEVEL% == 0 echo ERROR: Building language %%a failed & goto END
) )
>>".\Installer\Languages.nsh" echo ^^!define LANGUAGES "%LANGUAGES%" >>".\Installer\Languages.nsh" echo ^^!define LANGDLL_PARAMS "%LANGDLL_PARAMS%"
>>".\Installer\Languages.nsh" echo ^^!define LANGUAGE_IDS "%LANGUAGE_IDS%"
:: Restore English :: Restore English
echo #include "English.h"> "..\Language\Language.rc" echo #include "English.h"> "..\Language\Language.rc"

View File

@ -138,7 +138,7 @@ Function .onInit
${OrIf} $0 <> $LANGUAGE ${OrIf} $0 <> $LANGUAGE
${AndIf} $NonDefaultLanguage != 1 ${AndIf} $NonDefaultLanguage != 1
; New install or better match ; New install or better match
LangDLL::LangDialog "$(^SetupCaption)" "Please select the installer language.$\n$(SELECTLANGUAGE)" AC ${LANGUAGES} "" LangDLL::LangDialog "$(^SetupCaption)" "Please select the installer language.$\n$(SELECTLANGUAGE)" AC ${LANGDLL_PARAMS} ""
Pop $0 Pop $0
${If} $0 == "cancel" ${If} $0 == "cancel"
Abort Abort
@ -207,6 +207,12 @@ Function .onInit
Quit Quit
${EndIf} ${EndIf}
${EndIf} ${EndIf}
; If the language was set to a non-existent language, reset it back to English.
${WordFind} ",${LANGUAGE_IDS}" ",$LANGUAGE," "E+1{" $0
${If} ${Errors}
StrCpy $LANGUAGE "1033"
${EndIf}
${Else} ${Else}
; Exchange settings with user instance ; Exchange settings with user instance
!insertmacro UAC_AsUser_Call Function ExchangeSettings ${UAC_SYNCREGISTERS} !insertmacro UAC_AsUser_Call Function ExchangeSettings ${UAC_SYNCREGISTERS}