SevenZipSharp icon indicating copy to clipboard operation
SevenZipSharp copied to clipboard

SevenZipExtractor.ExtractArchive called with wrong password hangs onto resources

Open lloydj2ons opened this issue 3 years ago • 1 comments

Hi, I am having problems calling the ExtractArchive method with a wrong password. It throws an exception which I handle, however, it seems to hang onto file resources which causes the following test to fail. If I run the following tests on its own, it passes.

The output from the second test when it fails is below: The next test fails with the following details: Result StackTrace: at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel) at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) at System.IO.Directory.Delete(String path, Boolean recursive) at qob_processor_prototype.test.BaseTests.CleanOutput() in D:\SOURCE_CODE_C#\qob-processor-prototype\qob-processor-prototype\qob-processor-prototype.test\Base.Test.cs:line 74 at qob_processor_prototype.test.BaseTests.Init() in D:\SOURCE_CODE_C#\qob-processor-prototype\qob-processor-prototype\qob-processor-prototype.test\Base.Test.cs:line 17 Result Message: Initialization method qob_processor_prototype.test.ZipTests.Init threw exception. System.UnauthorizedAccessException: Access to the path '7z32.dll' is denied..

Any ideas please?

lloydj2ons avatar Oct 18 '22 09:10 lloydj2ons

Hi, I think I've solved this one by myself, I found the SevenZipExtractor.Check() method which I can use to check my password before I call the ExtractArchive() method. Thanks for a great bit of software, really useful :)

lloydj2ons avatar Oct 18 '22 16:10 lloydj2ons