Wox-launcher / Wox

A cross-platform launcher that simply works
http://wox-launcher.github.io/Wox/
GNU General Public License v3.0
24.62k stars 2.37k forks source link

UnauthorizedAccessException is stopping search for programs #3190

Closed bitkleberAST closed 1 year ago

bitkleberAST commented 4 years ago

I want Wox to enumerate all programs in my portable Apps folder. I found that this does not work, some programs are not found below "E:\Programme Portable".

I might found the problem by debugging Wox: In Win32.cs/ProgramPaths() an UnauthorizedAccessException occurs: "Access to the path 'E:\Programme Portable\PortableApps\Wox\AppData\Local\Microsoft\Windows\INetCache\Content.IE5' is denied."

As the exception handling occurs outside the search for executables/files the search is stopped and only the pathes are returned that were found so far.

In my oppinion SecurityExceptions and UnauthorizedAccessException (maybe all other exception types too?) should be handled within the enumeration for files. Logs would be written, but search wouldn't be cancelled.

Can anybody confirm that this is the reason for the problem, please? Am I right about the possible solution? Are there other places in code where the same problem can occur?

bitkleberAST commented 4 years ago

Never mind, putting it inside the for each does not make things better as the enumeration of the files in for eaches head does trigger the exception. Some people ran into the same problem and are suggesting some sort of safe-walk implementations on (Stackoverflow) to work around this. I will have a look at it later. Hopefully I can present a solution then. :)