7-Zip-zstd icon indicating copy to clipboard operation
7-Zip-zstd copied to clipboard

Error when extracting zip file

Open LulzRose opened this issue 1 year ago • 5 comments

When using context menu extract the message Cannot find archive name is displayed. When 7zip is opened, it can be extracted without issue.

LulzRose avatar Jun 27 '23 20:06 LulzRose

Would be awesome to get a fix, this is the main way I use 7zip.

WAUthethird avatar Aug 01 '23 03:08 WAUthethird

Having the same issue too.

TouchfuzzyGH avatar Aug 05 '23 10:08 TouchfuzzyGH

Also have the issue. Worked fine on v22.01-v1.5.5-R2 & broke after updating to v22.01-v1.5.5-R3.

Downgrade by running the old 7z22.01-zstd-x64.exe installer from v22.01-v1.5.5-R2 directly over the R3 installation fixed it.

Here's what it does

https://github.com/mcmilk/7-Zip-zstd/assets/7283693/289df801-2127-47a6-9654-24cd76043db7

DerekZiemba avatar Aug 22 '23 13:08 DerekZiemba

I am sure the issue is not the version, but the inconsistency after upgrade (library for integration in file explorer didn't update therefore doesn't match new 7z.dll)... Basically same issue than https://github.com/mcmilk/7-Zip-zstd/pull/313#issuecomment-1504914800.

Thus can be closed as duplicate... I have no idea whether and in which cases MSI installer may not correctly upgrade everything, even after reboot. Or whether it is a bug of install-script. I'll take a closer look later.

sebres avatar Sep 11 '23 14:09 sebres

Hmm... The issue (with not renaming .tmp by install) may happen here: https://github.com/mcmilk/7-Zip-zstd/blob/62bfad55c339f7f76b1880a59378245b6dfbbf49/C/Util/7zipInstall/7zipInstall.c#L1560 Just I still don't follow why - since it seems to add the operation to HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations properly and the reason why it'd fail at start would be only access denied (why?) or some similar circumstances. How it will be installed? Hopefully as admin or with UAC elevation?

Current algorithm looks like:

  1. try to open file to write in-place (with original name)
  2. write file with current name (original or tmp)
  3. if it failed, try to find unused .tmp name (with some hex inside, up to 100 times) and repeat
  4. if it success stop and when that was tmp-file, register pending rename with MoveFileExW

No idea why it doesn't work, so the only attempt to "repair" I can imagine at the moment would be something like this: try to rename current non-writable file to .tmp (if library is used, it is mostly not writable, but normally can be renamed) and then if it is successful, to write the file with original name without a necessity to rename it back with MoveFileExW later. And then register pending delete for that tmp-file (also with MoveFileExW). In the case MoveFileExW would fail for some reason, the new DLL has already correct name and possibly only tmp-file remains as a small leak in the 7z-install folder.

sebres avatar Sep 12 '23 14:09 sebres