Closed bitkleberAST closed 1 year ago
Never mind, putting it inside the for each
does not make things better as the enumeration of the files in for each
es 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. :)
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()
anUnauthorizedAccessException
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?