Skip to content

Commit bb9eb5f

Browse files
kjkclaude
andcommitted
Don't hardcode English file-type names in registry (fixes #3323)
The installer wrote a hardcoded English friendly name (e.g. "PDF File") into each progID's (Default) value, which overrides the localized type name Windows generates -- so non-English systems showed English names in Explorer's "Type" column. Delete that value instead, letting Windows fall back to the localized name. Deleting (rather than just not writing) also clears the stale English value left by previous versions on upgrade. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4831e1f commit bb9eb5f

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

docs/md/Version-history.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
Available in [pre-release](https://www.sumatrapdfreader.org/prerelease) builds.
66

7+
- associated file types now show their localized name in Explorer's "Type" column on non-English Windows; previously registration hardcoded an English name like "PDF File", overriding the name Windows would localize (fixes #3323)
78
- add `CmdExpandToCurrentPage` (`Expand TOC to Current Page`, in the Bookmarks sidebar right-click menu and the `Ctrl + k` command palette) to expand the table of contents tree down to the current page's entry and select it, like Explorer's "Expand to current folder" (fixes #1998)
89
- Save As now warns instead of failing silently when a file can't be written (e.g. the destination path exceeds the Windows `MAX_PATH` limit); previously there was no way to tell the save hadn't happened (fixes #1016)
910
- can convert an image to a PDF: right-click an image (or an open image document) and choose `Image / Convert to PDF`, or pick `PDF` in the format drop-down of the Save Image dialog. The new PDF gets `CreationDate`/`ModDate` metadata with the current time and time zone (fixes #949)

src/RegistryInstaller.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ static bool RegisterForOpenWith(HKEY hkey, const char* installedExePath) {
186186
char* progIDKey = str::JoinTemp("Software\\Classes\\", progIDName);
187187
// ok &= CreateRegKey(hkey, progIDKey);
188188

189-
// .pdf => "PDF file"
190-
char* extUC = str::ToUpperInPlace(str::DupTemp(ext + 1));
191-
char* desc = str::JoinTemp(extUC, " File");
192-
ok &= LoggedWriteRegStr(hkey, progIDKey, nullptr, desc);
189+
// Don't set the progID's friendly name (its (Default) value). A hardcoded
190+
// English string like "PDF File" overrides the localized type name that
191+
// Windows generates for the file type, so non-English systems wrongly show
192+
// English names in Explorer's "Type" column (issue #3323). Delete any value
193+
// a previous version wrote so Windows falls back to the localized name.
194+
ok &= LoggedDeleteRegValue(hkey, progIDKey, nullptr);
193195
// ok &= LoggedWriteRegStr(hkey, progIDKey, L"AppUserModelID", L"SumatraPDF"); // ???
194196

195197
// Per https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-extracticona

0 commit comments

Comments
 (0)