valinet / ExplorerPatcher

This project aims to enhance the working environment on Windows
GNU General Public License v2.0
24.1k stars 1.04k forks source link

The explorer console will not pop-up after enable console and restart file explorer #3377

Closed GitPopcorn closed 3 months ago

GitPopcorn commented 3 months ago

OS Version: Windows 11 23H2 22631.3737 EP Version: 22621.3527.65.5 Other Related Applications: Stardock Start11, Stardock Groupy

Only a console about properties panel GUI will be shown, but no logs for operations like updating operation will be printed. The GUI console only print log like:

Running on Windows 11, OS Build 10.0.22631.3737.
C:\Program Files\ExplorerPatcher\settings.reg
Started "GUI" thread.
458 395 - 750 710

Only a few operations like "Restore default settings" will print log in this console.

And there were no valuable or related logs in the Windows System Events either.

Dose EP fail to do injection? But how could I check it? I have read the wiki and checked WIN + X, the menu worked fine, so I think that the symbols in my system just worked, but there is no further way for me to check the working status of EP.

By the way, most configurations like Taskbar style, Control interface type of file explorer has been invalid, so I just wanna take a look at console to find the cause. While some other functions like Show Task view button, Disable the Windows 11 context menu just worked normally, however, still print no logs when change settings to this functions.

These features did not lost efficacy when I install Stardock Start11 and Stardock Groupy. It's... just went away after a common system boot up. I have repeat the system reset process for several times and every time EP will work fine at first. I don't know what operation broken the functions of EP, system upgrading? registry corruption? COM component changing, authority changing or the blocking of anti-virus... There were too many elements to be doubt but hard to be verify. I just wanted to found more error details about this.

pyrates999 commented 3 months ago

what do you mean? is there no console being shown?

GitPopcorn commented 3 months ago

what do you mean? is there no console being shown?

Not exactly. In fact I do get a console with title "Properties (ExplorerPatcher)" when I enable console and then restart EP properties window, but it only prints logs at very few operations, and be far different from the console I see in wiki which titled as "Explorer" and print detail logs for almost everything. Are these two console the same one?

pyrates999 commented 3 months ago

click on restart file explorer in the bottom left after you've enabled or disable the console.

GitPopcorn commented 3 months ago

click on restart file explorer in the bottom left after you've enabled or disable the console.

Yes I do it at first, enable console, then lick the button to restart file explorer, but found no console showed. It only showed when I restart the properties panel of EP, and print only several lines of log as I said above. I don't know if this has happend to anyone else...

pyrates999 commented 3 months ago

Please take a video to show what you mean.

GitPopcorn commented 3 months ago

Please take a video to show what you mean.

GIF-3

pyrates999 commented 3 months ago

that is odd. Try the following after you've enabled console:

Open up task manager and kill explorer.exe and then run task manager again and run explorer.exe

GitPopcorn commented 3 months ago

that is odd. Try the following after you've enabled console:

Open up task manager and kill explorer.exe and then run task manager again and run explorer.exe

It's sad that nothing has changed. GIF-2

pyrates999 commented 3 months ago

Ok, not sure then. I would try uninstalling and installing the latest pre-release then: https://github.com/valinet/ExplorerPatcher/releases/tag/22621.3527.65.5_6f6666b

GitPopcorn commented 3 months ago

Ok, not sure then. I would try uninstalling and installing the latest pre-release then: https://github.com/valinet/ExplorerPatcher/releases/tag/22621.3527.65.5_6f6666b

Yes I am using the latest pre-release version 22621.3527.65.5, and I have tried to reinstall it to solve this issue, but not seems to take a effect. Maybe something did block EP to take control to the explorer, but it's weird that I can still use part of features of EP, like Disable the Windows 11 context menu.

I will also try to uninstall and install it with newly downloaded EP setup package later, hope this time it will work.

pyrates999 commented 3 months ago

Windows Defender might be blocking it.

Set windows defender to exclude the following:

  1. C:\Program Files\ExplorerPatcher
  2. %APPDATA%\ExplorerPatcher

Future updates to EP won't be flagged then.

You can also set windows defender to exclude the directory that you manually download EP to so you can install it without windows defender blocking it.

Then uninstall it and reinstall it.

GitPopcorn commented 3 months ago

Windows Defender might be blocking it.

Set windows defender to exclude the following:

  1. C:\Program Files\ExplorerPatcher
  2. %APPDATA%\ExplorerPatcher

Future updates to EP won't be flagged then.

You can also set windows defender to exclude the directory that you manually download EP to so you can install it without windows defender blocking it.

Then uninstall it and reinstall it.

I have always test in the environment with no anti-virus program, of course I have disabled Windows Defender too. But I just found a new things about EP, that in the course of my repeative and boring reinstall tests, I have run the wrong installer of EP 22621.2361.58.4 inadvertently,which is a version released last year. But you know what? it just noticed me that there were some incorrect remains to prevent me from installing new EP. That's a TOTALLY NEW NOTICE to me!

And what's important comes, when I clean remains as it said, and then install the latest EP, ALL THE FEATURES JUST CAME BACK! The EP began to download symbols after installing, and the console of explorer just worked normally!

But good time don't last long, after a reboot, everything turned back, and I can not reproduce it any more. No matter how I install the EP in anyway I could think after that, like install without uninstalling before, overwrite some files with nonsense mannally, it just give no response to me, just overwrites the files, registries and then falls into silence.

So do you know in which case EP will prompt the notice of incorrect remains detected? How could I make it reproduced manually? And should I delete the symbol files after uninstalling EP? Why sometimes EP dose check and download the symbols but other time not?

GitPopcorn commented 3 months ago

Windows Defender might be blocking it.

Set windows defender to exclude the following:

  1. C:\Program Files\ExplorerPatcher
  2. %APPDATA%\ExplorerPatcher

Future updates to EP won't be flagged then.

You can also set windows defender to exclude the directory that you manually download EP to so you can install it without windows defender blocking it.

Then uninstall it and reinstall it.

Well I just screwed up. I am too hurry to reproduce the situation, so I restore to the saved restore point before that test, but no miracles happened. I lost the chance to save the whole registry to check and compare.

That is the actually part I don't like about test to EP, it's a totally black box to me that I could never know why it lost effect and can not trace the things has happened, no logs, no warnings, just a correct installing but not to take effect. Just waste two hours of my weekends to do the random test again.

Gonna give up, maybe I will do some more tests in the Windows sandbox, but could no longer test on my main PC. this issue could be closed.

GitPopcorn commented 3 months ago

Windows Defender might be blocking it.

Set windows defender to exclude the following:

  1. C:\Program Files\ExplorerPatcher
  2. %APPDATA%\ExplorerPatcher

Future updates to EP won't be flagged then.

You can also set windows defender to exclude the directory that you manually download EP to so you can install it without windows defender blocking it.

Then uninstall it and reinstall it.

Last test group under Windows Sandbox: The differences between correct installing under sandbox and incorrect installing under normal system:

  1. The incorrect installing could not write registries like HKEY_CURRENT_USER\Software\ExplorerPatcher, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer, even run as Administrator.
  2. The incorrect installing will add a additional scheduled task named CreateExplorerShellUnelevatedTask.

No more difference, and that's all I can do.

I am going to clean up the messy environment of my system after test.

GitPopcorn commented 3 months ago

Windows Defender might be blocking it.

Set windows defender to exclude the following:

  1. C:\Program Files\ExplorerPatcher
  2. %APPDATA%\ExplorerPatcher

Future updates to EP won't be flagged then.

You can also set windows defender to exclude the directory that you manually download EP to so you can install it without windows defender blocking it.

Then uninstall it and reinstall it.

Well, after reading the source code for a while, I have found some more informations: the C:\Windows\dxgi.dll which is placed by EP has not been loaded by "C:\Windows\explorer.exe", so that all the functions includes GetDllClassObject, Inject(). AllocConsole() in it will not be loaded, of course there will be no console for explorer.

But, why? why "C:\Windows\explorer.exe" did not load the "C:\Windows\dxgi.dll" in the same folder? That behaviour supposes to be guaranteed by all the WIN32 graphic application, to load dxgi.dll from it's source directory.

The file of dxgi.dll is fine, I have checked the MD5, and tested with rundll32.

I don't know what to do now...

GitPopcorn commented 3 months ago

Windows Defender might be blocking it.

Set windows defender to exclude the following:

  1. C:\Program Files\ExplorerPatcher
  2. %APPDATA%\ExplorerPatcher

Future updates to EP won't be flagged then.

You can also set windows defender to exclude the directory that you manually download EP to so you can install it without windows defender blocking it.

Then uninstall it and reinstall it.

Finally I successfully injected C:\Windows\dxgi.dll into explorer with regsitry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers, but the console still not came back, I tried with C:\Program Files\ExplorerPatcher\ExplorerPatcher.amd64.dll and got the same result. Maybe different type of dll injection will call different entry function... I feel desperate...

pyrates999 commented 3 months ago

I don't understand what you're trying to do here. Install the latest pre-release: https://github.com/valinet/ExplorerPatcher/releases/tag/22621.3527.65.5_6f6666b

GitPopcorn commented 3 months ago

I don't understand what you're trying to do here. Install the latest pre-release: https://github.com/valinet/ExplorerPatcher/releases/tag/22621.3527.65.5_6f6666b

... I have already installed the latest pre-release and tested it for almost one week.

pyrates999 commented 3 months ago

what hardware are you running windows on?

GitPopcorn commented 3 months ago

Alright finally I found the reason. Some protect program has add the DirectX 2D Drawing DLL ddraw.dll, which dependes on the DirectX DLL dxgi.dll, to the registry of KnownDLLs HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs, makes these two libraries loaded in to memory by NT kernel when system boot, and no longer being searched across relative positions includes C:\Windows.

GitPopcorn commented 3 months ago

But a further little question, why explorer.exe could not be launched within a DDL redirection? I tried to create foler explorer.exe.local or put the dxgi.dll into it, the logs of explorer.exe always get stuck at Initialized taskbar centering module., logically speaking the behavior within a DDL redirection should be totally same to the original way.

The failure logs are like:

[IME] Context menu patch status: 1
Setup inputswitch functions done
Setup peopleband functions done
Installed hooks.
Open Start on monitor thread
Started "Signal shell ready" thread.
Started "Open Start on current monitor" thread.
EP Service Window thread
Initialized taskbar centering module.

While the normal logs are like:

...
[IME] Context menu patch status: 1
Setup inputswitch functions done
Setup peopleband functions done
Installed hooks.
Open Start on monitor thread
Started "Signal shell ready" thread.
Started "Open Start on current monitor" thread.
EP Service Window thread
Initialized taskbar centering module.
[Positioning] Added settings for monitor 0000000000010001 : 0
Registered Win+A, Win+B, and Win+N
Progman: 262914
Progman hook: 918093
0 0
Setup sndvolsso functions done
Ended "Signal shell ready" thread.
[EnsureXAML] 46 ms.
[Updates] Starting daemon.
[Updates] Configured update policy on this system: "Check for updates but let me choose whether to download and install them".
[Updates] Path to module: C:\Windows\dxgi.dll
[Updates] Using hardcoded hash.
[Updates] Checking against hash "22622.3527.65.5.4dc5c4ef26f8e30b"
[Updates] Update URL: https://github.com/valinet/ExplorerPatcher/releases/latest/download/ep_setup.exe
...
GitPopcorn commented 3 months ago

Anyhow, I can close this issue finally, wish to have a good sleep tonight.