Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to switch internal decompression helpers #4540

Closed
HUMORCE opened this issue Nov 26, 2021 · 9 comments · Fixed by #5424
Closed

Provide a way to switch internal decompression helpers #4540

HUMORCE opened this issue Nov 26, 2021 · 9 comments · Fixed by #5424
Labels

Comments

@HUMORCE
Copy link
Member

HUMORCE commented Nov 26, 2021

versions/7zip-zstd depend on main/7zip

see also:
https://github.com/ScoopInstaller/Extras/issues/7425#issuecomment-980271210

Scoop/lib/core.ps1

Lines 253 to 257 in 59088a9

'7zip' {
$HelperPath = Get-AppFilePath '7zip' '7z.exe'
if([String]::IsNullOrEmpty($HelperPath)) {
$HelperPath = Get-AppFilePath '7zip-zstd' '7z.exe'
}

@rasa rasa added the bug label Nov 26, 2021
@rashil2000
Copy link
Member

Tracked here ScoopInstaller/Versions#352

@HUMORCE
Copy link
Member Author

HUMORCE commented Jan 15, 2022

@rashil2000 the bug cannot be solved by solving ScoopInstaller/Versions#352

@rashil2000
Copy link
Member

Assuming 7zip-zstd can be installed without 7zip, then the helperpath will point to 7zip-zstd's 7z.exe binary, right?

@HUMORCE
Copy link
Member Author

HUMORCE commented Jan 15, 2022

yes, but what if users need to install both of them.

@rashil2000
Copy link
Member

Screenshot (109)

I'm not able to reproduce the issue

@HUMORCE
Copy link
Member Author

HUMORCE commented Jan 15, 2022

nothing to do with scoop-reset.

func Get-HelperPath always use main/7zip as helper of Expand-7zipArchive, if you have both main/7zip and versions/7zip-zstd installed.

reproduction steps:

PS C:\Users\HUMOR\Desktop> scoop list 7zip
Installed apps matching '7zip':

  7zip 21.07 [main]
  7zip-zstd v21.03-v1.5.0-R2 [versions]

PS C:\Users\HUMOR\Desktop> scoop install .\t.json
Installing 't' (0) [64bit]
Loading dl.7z from cache
WARN  Warning: No hash in manifest. SHA256 for 'dl.7z' is:
    4ff3f914fc6c1b56cbfe16fee1c95f46e6c72c1817406e8a5397a5b30fba0c5f
Extracting dl.7z ... ERROR Exit code was 2!
Failed to extract files from C:\Users\HUMOR\scoop\apps\t\0\dl.7z.
Log file:
  ~\scoop\apps\t\0\7zip.log

Please try again or create a new issue by using the following link and paste your console output:
https:////
PS C:\Users\HUMOR\Desktop> cat ~\scoop\apps\t\0\7zip.log

7-Zip 21.07 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-12-26
...
PS C:\Users\HUMOR\Desktop> scoop uninstall 7zip
Uninstalling '7zip' (21.07).
Removing shim '7z.exe'.
Removing shim '7z.shim'.
Removing shortcut ~\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps\7-Zip.lnk
Unlinking ~\scoop\apps\7zip\current
PS C:\Users\HUMOR\Desktop> scoop install .\t.json
Installing 't' (0) [64bit]
Loading dl.7z from cache
WARN  Warning: No hash in manifest. SHA256 for 'dl.7z' is:
    4ff3f914fc6c1b56cbfe16fee1c95f46e6c72c1817406e8a5397a5b30fba0c5f
Extracting dl.7z ... ERROR Exit code was 2!
Failed to extract files from C:\Users\HUMOR\scoop\apps\t\0\dl.7z.
Log file:
  ~\scoop\apps\t\0\7zip.log

Please try again or create a new issue by using the following link and paste your console output:
https:////
PS C:\Users\HUMOR\Desktop> cat ~\scoop\apps\t\0\7zip.log

7-Zip 21.03 ZS v1.5.0 R2 (x64) : Copyright (c) 1999-2021 Igor Pavlov, 2016-2021 Tino Reichardt : 2021-10-05
...
PS C:\Users\HUMOR\Desktop> cat .\t.json
{
    "version": "0",
    "url": "https://github.com#/dl.7z"
}

@rashil2000
Copy link
Member

I see.

But what is the benefit of using 7zip-zstd in the helper instead of 7zip (if you have both installed)?

(I assume for .zst archives, Scoop will download zstd.exe separately, and not use 7zip-zstd for that.)

@HUMORCE
Copy link
Member Author

HUMORCE commented Jan 15, 2022

just another option? users may think that the decompression is done by the version of 7z set with scoop-reset.

@rashil2000
Copy link
Member

I see.

But since this is a special case, it shouldn't be handled by scoop reset.

@rashil2000 rashil2000 reopened this Jan 15, 2022
@rashil2000 rashil2000 changed the title Helper '7zip' cannot be switched via scoop reset 7zip|7zip-zstd Provide a way to switch internal decompression helpers Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants