ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
21k stars 1.4k forks source link

[Bug] Extraction `OperationStopped:` regression from #5973 or #5951 #5982

Closed brian6932 closed 3 months ago

brian6932 commented 4 months ago

Bug Report

Current Behavior

scoop install $($_ = 'test'; '{"version":"nightly","architecture":{"64bit":{"url":"https://secure-appldnld.apple.com/itunes12/052-51516-20240506-351B8BFB-C5A7-4FD8-8262-60CD9FAA1464/iTunes64Setup.exe#/_.zip"}}}' > $_; $_)
WARN  This is a nightly version. Downloaded files won't be verified.
Installing 'test' (nightly-20240520) [64bit] from '~\test'
Extracting iTunes64Setup.exe ...
GAC    Version        Location
---    -------        --------
False  v4.0.30319     ~\scoop\apps\pwsh-beta\current\WindowsBase.dll
OperationStopped:

Expected Behavior

Extract-7zipArchive used to work fine. Likely caused by #5973 or #5951.

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 7.5.0-preview.2

Additional software:

❯ scoop.ps1 list 7zip-beta
Installed apps matching '7zip-beta':

Name      Version Source   Updated             Info
----      ------- ------   -------             ----
7zip-beta 24.05   versions 2024-05-15 09:22:57 64bit

Scoop Configuration

{
  "alias": {},
  "debug": true,
  "cat_style": "full",
  "aria2-warning-enabled": false,
  "aria2-max-connection-per-server": "16",
  "aria2-min-split-size": "1M",
  "aria2-split": "64",
  "aria2-options": "--no-conf=false",
  "last_update": "2024-05-20T13:55:23.7586392-04:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "develop",
  "use_lessmsi": true,
  "use_external_7zip": true,
  "use_sqlite_cache": true
}
niheaven commented 4 months ago

Could not reproduce here, what's the 7zip log?

brian6932 commented 4 months ago

There's no log file in the dir

❯ ls ~\scoop\apps\test\nightly-20240521

        Directory:
    ~\scoop\apps\test\nightly-20240521

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a---        2024-05-06   6:34 PM      211265904   _.zip

After another look, I noticed that this only occurs when the file extension's renamed to .zip, .7z works as expected.

niheaven commented 4 months ago

The extractor choosing function is not changed, and both Expand-7zipArchive() and Expand-ZipArchive() should extract the zip file. Is there an error in PS5 or main branch?

niheaven commented 4 months ago

And is there any error when installing other zip archives, e.g., ag?

brian6932 commented 4 months ago

Is there an error in PS5 or main branch?

Doesn't happen on the master branch.

❯ $Error
OperationStopped:

New-Object: Exception calling ".ctor" with "3" argument(s): "End of Central Directory record could not be found."

And is there any error when installing other zip archives, e.g., ag?

Haven't seen any so far, I've only updated my branch for a day so far.

niheaven commented 4 months ago

Ref: https://stackoverflow.com/a/20960434

Since the archive is indeed a CAB file, Expand-ZipArchive() encountered this error.