@@ -403,46 +403,6 @@ HRESULT NppShell::Installer::Uninstall()
403403 return S_OK;
404404}
405405
406- void EnsureRegistrationOnCurrentUserWorker ()
407- {
408- // Initialize the WinRT apartment.
409- winrt::init_apartment ();
410-
411- // Get the package to check if it is already installed for the current user.
412- Package existingPackage = GetSparsePackage ();
413-
414- if (existingPackage == NULL )
415- {
416- // The package is not installed for the current user - but we know that Notepad++ is.
417- // If it wasn't, this code wouldn't be running, so it is safe to just register the package.
418- RegisterSparsePackage ();
419-
420- // Finally we notify the shell that we have made changes, so it reloads the right click menu items.
421- SHChangeNotify (SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0 , 0 );
422- }
423- }
424-
425- void NppShell::Installer::EnsureRegistrationOnCurrentUser ()
426- {
427- // First we find the name of the process the DLL is being loaded into.
428- wstring moduleName = GetExecutingModuleName ();
429-
430- if (moduleName == L" explorer.exe" )
431- {
432- const bool isWindows11 = IsWindows11Installation ();
433-
434- if (isWindows11)
435- {
436- // We are being loaded into explorer.exe, so we can continue.
437- // Explorer.exe only loads the DLL on the first time a user right-clicks a file
438- // after that it stays in memory for the rest of their session.
439- // Since we are here, we spawn a thread and call the EnsureRegistrationOnCurrentUserWorker function.
440- thread ensureRegistrationThread = thread (EnsureRegistrationOnCurrentUserWorker);
441- ensureRegistrationThread.detach ();
442- }
443- }
444- }
445-
446406STDAPI CleanupDll ()
447407{
448408 // First we get the full path to this DLL.
0 commit comments