Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer language is Afrikaans instead of English on Windows Server 2016. #7574

Closed
rbarte opened this issue Nov 14, 2019 · 18 comments
Closed

Comments

@rbarte
Copy link

rbarte commented Nov 14, 2019

Description of the Issue

The Notepad++ installer instead of English is shown in Afrikaans. Afterwards also the notepad++ is shown in this language.
Language and regional settings on Windows 2016 OS are set to US (English).

Found similar closed bug: #3844
and
https://community.notepad-plus-plus.org/topic/14564/dutch-as-install-language-instead-of-english

Steps to Reproduce the Issue

  1. Double click on the "npp.7.8.1.Installer.x64.exe".
  2. Confirm UAC.
  3. Installer is shown in Afrikaans.
  4. After installation the Notepad++ application is also in Afrikaans.

Expected Behavior

Installer is shown in English (like other installers on US/English OS).

Actual Behavior

Installer is shown in Afrikaans, also the installed application defaults to it.

Debug Information

Windows Device Guard is active on this system.

2019-11-14 10_21_25-NotepadPP
2019-11-14 10_30_37-Windows-Regional1
2019-11-14 10_31_00-Windows-Regional2
2019-11-14 10_31_00-Windows-Regional3
2019-11-14 10_31_00-Windows-Regional4
2019-11-14 10_37_09-notepadpp-gui

@aaimaai
Copy link

aaimaai commented Nov 24, 2019

That's not Dutch but Afrikaans. Because of its name (or its iso-code "af") it's probably the first language in the language list.

@rbarte rbarte changed the title Installer language Dutch instead of English on Windows 2016. Installer language is Afrikaans instead of English on Windows Server 2016. Dec 7, 2019
@rbarte
Copy link
Author

rbarte commented Dec 7, 2019

That's not Dutch but Afrikaans. Because of its name (or its iso-code "af") it's probably the first language in the language list.

Thank you - I've changed the description and title.

@TotiTolvukall
Copy link

I wish to add to this instead of filing another duplicate.

Locale is Icelandic, display language is Icelandic, I used winget to install Notepad++ 8.4.7 and it installed with an Afrikaans display language. Which of course is useless to me ( and 99.999% of the people in Iceland as we don't speak Afrikaans - in favor of Icelandic, English, Swedish and Danish.)

And this has been the case as long as I can remember. Notepad++ does not have a sane default in the installer - instead it's "select your poison or suffer the consequences" - which would be quite all right if the default demographic was South Africa. It is the same if you aimlessly click through the GUI installer (which is in fact what winget does - which is WHY the default MUST be fixed.)

@llamaonaskateboard
Copy link

I experienced this issue today with 8.5.1 x64 on Windows 10 - the installer skipped the language selection and jumped straight into Afrikaans.
The culprit ended up being McAfee Endpoint Security which somehow causes HKLM\SOFTWARE\WOW6432Node\Notepad++\InstallerLanguage to end up with the value Installer Language.
Deleting that registry key and disabling Access Protection whilst running the installer fixes the issue.

@donho
Copy link
Member

donho commented Sep 16, 2023

The installer x86 & x64 which contain the fix of this issue (#14125) are available here:
http://download.notepad-plus-plus.org/repository/MISC/fixInstallLangIssue/

They are the latest version 8.5.7 and binaries are signed.
Please test the installer of your choice, and confirm me if this issue has been fixed.

@TotiTolvukall
Copy link

I am not sure how I would go about verifying the EXE installer as it is an interactive installer, but the default it pops up with is Afrikaans regardless of the installed language or the selected language of the already installed NPP
image

On a server I would install the MSI (which requires a downloadable MSI) or via winget (which requires the fix to be deployed live - which I'm not so sure would be a good idea unless tested already).

@mpheath
Copy link
Contributor

mpheath commented Sep 20, 2023

If Afrikaans (1078) is saved in the registry from a previous install, then it is read as a supported LCID (Language Code Identifier).

A x64 registry entry that has saved Afrikaans:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Notepad++]
"InstallerLanguage"="1078"

Is a supported installer language so the current PR code allows it.

Installing in English would overwrite the registry value for future installs. On the Installer Language dialog, could select a language, click OK, then click Cancel on the next window and that will overwrite the registry value as a correction.

A system without the saved registry value should not show Afrikaans unless NSIS detects it as LCID 1078 initially. An unsupported LCID, like a English variant that is not US English (1033) or other unsupported LCID should be displayed as US English (1033).

@donho
Copy link
Member

donho commented Sep 22, 2023

The problem seems to be caused by McAfee: #7574 (comment)

So the issue is closed.

@donho donho closed this as completed Sep 22, 2023
@donho donho added the invalid Issues and PRs with missing minimum requirements data, or insufficient understandable explanation label Sep 22, 2023
@TotiTolvukall
Copy link

I appreciate the effort you put into this product for such a long time, but seriously, 👆that part needs some work.

No, the bug isn't caused by McAfee - you are pretending causation by correlation. I don't have McAfee or any other third-party virus scanner on any of my machines - so it would have been prudent to at least ask others in this thread if they used McAfee or not - and if they (everybody) did, re-try without McAfee active.

But whatever, this bug hindered using winget to install and thus hindered automatic updates. And that was almost a year ago. As I'm not inclined on offering NPP in Afrikaans to my clients or users, I simply solved it by using VS Code wherever and it turned out for the better. So don't lose a beat on my account.

@donho
Copy link
Member

donho commented Sep 22, 2023

@TotiTolvukall
I see your points.
I would like to do a walk-around by shooting in the dark, since I cannot reproduce the bug.
I will try to set English as default language while the language detection failure and there's no language selector.
Could you try this installer?

@donho donho reopened this Sep 22, 2023
@TotiTolvukall
Copy link

I already did - 2 days ago, and you said it was due to a registry key.

Here I re-did on a machine that already has NPP 8.4.6 installed with the English language chosen.
image

Same result - language chosen is Afrikaans - and because of that, the automatic clickthrough install method winget uses will fail (install the wrong language).

Here's what is already installed:
image

@mpheath
Copy link
Contributor

mpheath commented Sep 23, 2023

@donho

I will try to set English as default language while the language detection failure and there's no language selector.

I would not call it a failure of the language selector as it is intended behaviour. It's default mode is automatic and so it decides to show or not show based on conditions. The installer can force the language selector to show by defining MUI_LANGDLL_ALWAYSSHOW . The language selector does not show for silent installs. IMO, the McAfee comment is an unproven guess as a cause.

I would like to do a walk-around by shooting in the dark, since I cannot reproduce the bug.

A minimal test script may help to show some light.

Click to view test script
;!define FIX

; Include Modern UI
!include "MUI.nsh"

; Properly display all languages
Unicode true

; Name and file
!ifdef FIX
  Name "Fix"
  OutFile "LanguageFix.exe"
!else
  Name "Bug"
  OutFile "LanguageBug.exe"
!endif

; Request application privileges
RequestExecutionLevel user

; Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

; Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_RESERVEFILE_LANGDLL

Section "Install"
SectionEnd

Function .onInit
  ; debug: *** set UK English as unsupported language ***
  StrCpy $LANGUAGE "2057"
  MessageBox MB_OK "Before: $LANGUAGE (UK English)"

  !ifdef FIX
    Call unsupportedLanguageToEnglish
  !endif

  !define MUI_LANGDLL_ALWAYSSHOW
  !insertmacro MUI_LANGDLL_DISPLAY

  ; debug: *** Display language to use ***
  MessageBox MB_OK "After: $LANGUAGE"
FunctionEnd

!ifdef FIX
Function unsupportedLanguageToEnglish
  ${Switch} $LANGUAGE
    ${Case} ${LANG_AFRIKAANS}
    ${Case} ${LANG_ENGLISH}
      ; language is supported
      ${Break}
    ${Default}
      ; set language to English
      StrCpy $LANGUAGE ${LANG_ENGLISH}
      ; debug: *** Alert language unsupported ***
      MessageBox MB_OK "Language is unsupported.$\nChanged language to English"
      ${Break}
  ${EndSwitch}
FunctionEnd
!endif

The 1st line of the script has a commented ;define FIX. Compile the script and then uncomment that line, save and compile again to get 2 installers to test.

$LANGUAGE is set early in the script to UK English (2057) as an unsupported installer language.

  • Compiled without defining FIX displays Africaans in the language selector.
  • Compiled with defining FIX displays English in the language selector.

Can you to reproduce this behaviour?

As for the saved language in the registry from previous Notepad++ installs, that is a symptom from the installer that failed to handle unsupported languages and as a result defaulted to Afrikaans. Once done, how to recognize Afrikaans mistake from Afrikaans actual with the installer. The solution to correct by the installer might be a temporary brutal fix, though perhaps it may be needed to close this issue.

Something like this for several releases to clear the registry value

Click to view code excerpt
	ReadRegStr $tempLng HKLM "SOFTWARE\${APPNAME}" 'InstallerLanguage'
	${IfNot} ${Errors}
		${If} "$LANGUAGE" != "${LANG_AFRIKAANS}"
		${AndIf} "$tempLng" == "${LANG_AFRIKAANS}"
			DeleteRegValue HKLM "SOFTWARE\${APPNAME}" 'InstallerLanguage' ; tmp fix
		${Else}
			StrCpy $LANGUAGE "$tempLng" ; set default language
		${EndIf}
	${EndIf}

and then revert it back so that the users who prefer the Afrikaans language get control back.

@TotiTolvukall
Copy link

TotiTolvukall commented Sep 25, 2023

I couldn't - and moreover, I found that although NPP had been installed with English as the primary language, it still pointed to Afrikaans in the registry.

I do however have a suggestion that might mitigate the problem for those that use winget or other auto-click installation methods - allow a "--language=[language token]" like "--language=en" and if someone tries "--language=unsupported_language" then you'd exit with error and "Unsupported language" message to the user.
Using the --language parameter would then completely bypass the language selection popup.

That might at least (if supported by the installation framework) take the cap off of the problem.

@llamaonaskateboard
Copy link

llamaonaskateboard commented Sep 25, 2023

I can't reproduce McAfee causing issues on 8.5.1 or 8.5.7 anymore, guessing something changed in newer McAfee definitions.

As a test for @TotiTolvukall's issue, I installed the Icelandic language pack on a test Windows 10 VM, changed the current user and system language to Icelandic and can reproduce getting Afrikaans as the initial language selection on the installer. This is reproducible on both 8.5.1 and 8.5.7.
This is also without HKLM\SOFTWARE\WOW6432Node\Notepad++\InstallerLanguage existing yet.

Could this be because Icelandic is specifically commented out here for some reason and so isn't being considered a valid installer language?
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/v8.5.7/PowerEditor/installer/nsisInclude/langs4Installer.nsh#L50

image
image

In case anyone else wants to go on a fun adventure through the NSIS code...
Initial value of INST_LANG/$LANGUAGE is set by reading HKU\.DEFAULT\Control Panel\International\Locale here:
https://github.com/kichik/nsis/blob/v309/Source/exehead/Ui.c#L274
If that language isn't one of the loaded languages then it defaults to the first one:
https://github.com/kichik/nsis/blob/v309/Source/exehead/Ui.c#L224
The same logic is applied to the language selection dialog which selects the first item in the dropdown list is INST_LANG isn't found in the loaded language list:
https://github.com/kichik/nsis/blob/v309/Contrib/LangDLL/LangDLL.c#L77

For the Notepad++ installer, the first language in the list happens to be Afrikaans:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/v8.5.7/PowerEditor/installer/nsisInclude/langs4Installer.nsh#L23
It appears English was one the first but there's a commented out line for this above Afrikaans:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/v8.5.7/PowerEditor/installer/nsisInclude/langs4Installer.nsh#L19

@donho
Copy link
Member

donho commented Sep 26, 2023

@TotiTolvukall

I have tried to set English as default value while the detection is failed. Could you try the following binaries please?
http://download.notepad-plus-plus.org/repository/MISC/setEnglishAsDefaultLang

@donho donho removed the invalid Issues and PRs with missing minimum requirements data, or insufficient understandable explanation label Sep 26, 2023
@donho
Copy link
Member

donho commented Oct 1, 2023

Any news about it?

@TotiTolvukall
Copy link

Sorry, being busy has me forgetting things.

image

This seems to have proper behaviour ( WS2019 )

And on W11
image

@donho
Copy link
Member

donho commented Oct 4, 2023

@TotiTolvukall
Thank you for your testing.
Nice to learn that this issue will be fixed.

@donho donho closed this as completed in 64e95cc Oct 10, 2023
donho pushed a commit to donho/notepad-plus-plus that referenced this issue Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants