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

Using Notepad.exe hack, v8.4.9 opens file with wrong filetype selected. #13042

Closed
camileevzw opened this issue Feb 3, 2023 · 5 comments
Closed

Comments

@camileevzw
Copy link

Description of the Issue

Using the NPP hack to make notepad++.exe replace the windows default notepad.exe application to open files in Explorer by doubleclicking them, version 8.4.9 opens the file with the wrong filetype. Text files with .txt are being opened in NPP as JSON5 file type identified in the lower left corner of the editor.

Steps to Reproduce the Issue

  1. Follow steps to make Notepad++.exe the default Notepad replacement app here: https://npp-user-manual.org/docs/other-resources/#notepad-replacement
  2. Open portable version 8.4.9 so that it receives the request rather than the system installed version of NPP
  3. Open Explorer to find a .txt file (spaces in name doesn't matter in Windows 10 64 bit) Double-click the file

Expected Behavior

The text file to be opened in NPP v8.4.9 as a Text file

Actual Behavior

8.4.9 version opens the text file as a JSON5 file, the text of which will be highlighted as syntax errors in orange.

Debug Information

Notepad++ v8.4.9 (64-bit)
Build time : Jan 27 2023 - 03:11:16
Path : C:\Users\camilee\Documents\Development Tools Downloads\Notepad++ Versions\npp.8.4.9.portable.x64\notepad++.exe
Command Line : -notepadStyleCmdline -z "C:\WINDOWS\system32\NOTEPAD.EXE" C:\Users\camilee\Desktop\Home Documents\Health\Daily Meds Lee.txt
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 22H2
OS Build : 19045.2486
Current ANSI codepage : 1252
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppExport (0.4)

Showing the result of trying to open text file by double-clicking in File Explorer with the hack in place in v. 8.4.9:
github8_4_9BugSpacesInFileName

This shows the hack properly installed in this shot of the Registry Editor:

JSON5txtfileopeningHackinRegistry

Bringing to your attention as requested, Don. @donho

@camileevzw
Copy link
Author

Forgot to include this screenshot, showing that new files default in that NPP version should be text which is standard.
JSON5NotSetAsDefault

@alankilborn
Copy link
Contributor

This issue originated as a discussion here:
https://community.notepad-plus-plus.org/topic/24081/notepad-v8-4-9-release

@donho
Copy link
Member

donho commented Feb 4, 2023

This issue is happening because you still keep a previous version of Notepad++ on your machine (in C:\Program File\Notepad++\ ) but the launched instance is version v8.4.9 which you put in another folder.

The scenario of issue cause is: when you use context menu or Notepad replacement, both point to C:\Program File\Notepad++\notepad++.exe which is, let's say version 8.4.8, without the support of JSON5, so a unknown language file is detected by C:\Program File\Notepad++\notepad++.exe (v8.4.8) as ENUM_UNKNOWN (number 86), then it passes number 86 as detected language to the launched instance C:\you-new-v849-folder\Notepad++\notepad++.exe, in which (v8.4.9) JSONS5 has been added as 86 and ENUM_UNKNOWN has been shifted to 87 - then this anomaly. happens.

To remedy this issue, updating C:\Program File\Notepad++\notepad++.exe from v8.4.8 to v8.4.9 is necessary, via installer or copy/paste notepad++.exe manually.

@donho donho closed this as completed Feb 4, 2023
@svenbolte
Copy link

Sorry, but the issue is still present with 8.4.9

I have only installed Version 8.4.9x64 (installed with Setup) on my system and added the
Np++ Replacement Reg line with elevated rights.

It happens that when you dblclick on a file in explorer where filename or path contains spaces like "c:\temp dir\my file.php" n++ opens and displays as many error messages (file/path parts) as there are spaces in the path line.
(Right mouse klick on explorer context (open with notepad++) works with win10prox64)

Uninstalling it and installing 8.4.8 or smaller version makes it work again. only thing replaced on my system was 8.48 by 8.49

@donho
Copy link
Member

donho commented Feb 5, 2023

@svenbolte
That's another bug, which has been fixed in 5aeb8ab. The fix will come with the next release.

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

No branches or pull requests

4 participants