From d9bccaf0a47b3f8a76e40fd79a1f6ea83c4c3ab7 Mon Sep 17 00:00:00 2001 From: Homes32 Date: Sat, 24 May 2025 13:19:20 -0500 Subject: [PATCH] Fixed Class not registered error when trying to open .xml files on some Win10 builds. (Issue #143) Bumped NPP version to v8.8.1 --- .../Productivity/Notepad++.script | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Projects/PhoenixPE/Applications/Productivity/Notepad++.script b/Projects/PhoenixPE/Applications/Productivity/Notepad++.script index 1fb80b4..d414ef9 100644 --- a/Projects/PhoenixPE/Applications/Productivity/Notepad++.script +++ b/Projects/PhoenixPE/Applications/Productivity/Notepad++.script @@ -30,19 +30,19 @@ [Main] Title=Notepad++ -Description=(v8.7.8.0) Notepad++ is a free and open source code editor and Notepad replacement that supports multiple languages. +Description=(v8.8.1.0) Notepad++ is a free and open source code editor and Notepad replacement that supports multiple languages. Author=Homes32 Level=5 Selected=True Mandatory=False -Version=1.4.12.0 +Version=1.5.0.0 Date=2025-03-07 [Variables] %ProgramFolder%="Notepad++" %ProgramExe%="notepad++.exe" %ShellExtDll%="NppShell_06.dll" -%ProgramVersion%=8.7.8 +%ProgramVersion%=8.8.1 %DownloadURLx86%=https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v%ProgramVersion%/npp.%ProgramVersion%.portable.7z %DownloadURLx64%=https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v%ProgramVersion%/npp.%ProgramVersion%.portable.x64.7z %aToolbarIconMap%=Fluent UI: small|small|Fluent UI: large|large|Filled Fluent UI: small|small2|Filled Fluent UI: large|large2|Standard icons: small|standard @@ -64,13 +64,16 @@ Decompress,"%ProgramsCache%\%ProgramFolder%\npp-%SourceArch%.7z","%TargetProgram Echo,"Configuring %ScriptTitle%..." +RegLoadHives + // Language (make sure this is configured before 'Minimal Install' Setting) FileCopy,"%TargetPrograms%\%ProgramFolder%\localization\%cmb_Language%.xml","%TargetPrograms%\%ProgramFolder%\nativeLang.xml" If,%cb_ReplaceNotepad%,Equal,True,Begin - RegHiveLoad,Tmp_Software,%RegSoftware% - RegWrite,HKLM,0x1,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe","Debugger","#$q%PEPrograms%\%ProgramFolder%\%ProgramExe%#$q -notepadStyleCmdline -z" - RegHiveUnLoad,Tmp_Software + RegWrite,HKLM,REG_SZ,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe","Debugger","#$q%PEPrograms%\%ProgramFolder%\%ProgramExe%#$q -notepadStyleCmdline -z" +End +Else,Begin + If,ExistRegValue,HKLM,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe","Debugger",RegDelete,HKLM,"Tmp_Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe","Debugger" End If,%cb_MinimalInstall%,Equal,True,Begin @@ -88,6 +91,10 @@ If,%cb_RegisterShellExt%,Equal,True,Run,%ScriptFile%,RegisterShellExtension // Register FileExt StrFormat,REPLACE,%txt_RegisterFileExt%,#$s,"",%txt_RegisterFileExt% ForEach,%Ext%,%txt_RegisterFileExt%,Delim=#$c,Associate,"%Ext%","%PEPrograms%\%ProgramFolder%\%ProgramExe%" +// Causes "Class not registered" error in some Win10 builds. +If,ExistRegValue,HKLM,"Tmp_Software\Classes\xmlfile\shell\Open\command","DelegateExecute",RegDelete,HKLM,"Tmp_Software\Classes\xmlfile\shell\Open\command","DelegateExecute" + +RegUnloadHives Echo,"Configuring %ScriptTitle%..." @@ -209,7 +216,8 @@ If,%cb_PinToStartMenu%,Equal,True,PinShortcut,StartMenu,Auto,"%PEPrograms%\%Prog // Parameters.....: // Return values..: // Author.........: Homes32 -// Remarks........: NppShell_06.dll included with this script has been recompiled from source with the /MT switch. This makes it +// Remarks........: RegHives must be loaded. +// NppShell_06.dll included with this script has been recompiled from source with the /MT switch. This makes it // slightly less memory efficient as far as shell extensions go, but we don't have to worry about making sure the // user selects the correct VC++ runtime component when they build the project. // Related........: @@ -218,18 +226,16 @@ If,%cb_PinToStartMenu%,Equal,True,PinShortcut,StartMenu,Auto,"%PEPrograms%\%Prog If,%txt_ShellContextMenuTxt%,Equal,"",WriteInterface,Value,%ScriptFile%,Interface,txt_ShellContextMenuTxt,"Edit with &Notepad++" ExtractFile,%ScriptFile%,%SourceArch%,"%ShellExtDll%","%TargetPrograms%\%ProgramFolder%" -RegHiveLoad,Tmp_Software,%RegSoftware% -RegWrite,HKLM,0x1,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}","","Notepad++" -RegWrite,HKLM,0x1,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\InprocServer32","","%PEPrograms%\%ProgramFolder%\%ShellExtDll%" -RegWrite,HKLM,0x1,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\InprocServer32","ThreadingModel","Apartment" -RegWrite,HKLM,0x1,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Custom","" -RegWrite,HKLM,0x4,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Dynamic",1 -RegWrite,HKLM,0x4,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Maxtext",25 -RegWrite,HKLM,0x1,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Path","%PEPrograms%\%ProgramFolder%\%ProgramExe%" -RegWrite,HKLM,0x4,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","ShowIcon",1 -RegWrite,HKLM,0x1,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Title","%txt_ShellContextMenuTxt%" -RegWrite,HKLM,0x1,"Tmp_Software\Classes\*\shellex\ContextMenuHandlers\Notepad++","","{B298D29A-A6ED-11DE-BA8C-A68E55D89593}" -RegHiveUnLoad,Tmp_Software +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}","","Notepad++" +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\InprocServer32","","%PEPrograms%\%ProgramFolder%\%ShellExtDll%" +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\InprocServer32","ThreadingModel","Apartment" +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Custom","" +RegWrite,HKLM,REG_DWORD,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Dynamic",1 +RegWrite,HKLM,REG_DWORD,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Maxtext",25 +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Path","%PEPrograms%\%ProgramFolder%\%ProgramExe%" +RegWrite,HKLM,REG_DWORD,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","ShowIcon",1 +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\CLSID\{B298D29A-A6ED-11DE-BA8C-A68E55D89593}\Settings","Title","%txt_ShellContextMenuTxt%" +RegWrite,HKLM,REG_SZ,"Tmp_Software\Classes\*\shellex\ContextMenuHandlers\Notepad++","","{B298D29A-A6ED-11DE-BA8C-A68E55D89593}" [#DownloadProgram#] // ===============================================================================================================================