ScoopInstaller / Scoop

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

[Feature] extract_dir support nested archive path #4624

Open caoli5288 opened 2 years ago

caoli5288 commented 2 years ago

Feature Request

Is your feature request related to a problem? Please describe.

Some apps need to write scripts to decompress and move files many times(NSIS apps). This feature is effective to simplify the manifests.

Describe the solution you'd like

Use the symbol ! as the separator(or any other). An example. "extract_to": "app-x64.zip!\\bin". It will expand app-x64.zip and extract the bin contains in the archive.

Describe alternatives you've considered

Here is an manifest https://github.com/caoli5288/scoop-bucket/blob/master/bucket/yesplaymusic.json. I write script in pre_install.

            "pre_install": [
                "Expand-7zipArchive \"$dir\\`$PLUGINSDIR\\app-64.7z\" \"$dir\"",
                "Remove-Item \"$dir\\`$*\", \"$dir\\Uninst*\" -Recurse"
            ]

It can be simplified to "extract_dir": "$PLUGINSDIR\\app-64.7z!\\". This is just a simple example. This feature can play more roles.

niheaven commented 2 years ago

This kind of extraction will be simplified when https://github.com/ScoopInstaller/Scoop/pull/3502 is done.

caoli5288 commented 2 years ago

This kind of extraction will be simplified when #3502 is done.

It's outdated and it seems not easy to use

niheaven commented 2 years ago

Do you have some more common use cases other than NSIS that use nested archives?

caoli5288 commented 2 years ago

Do you have some more common use cases other than NSIS that use nested archives?

See https://github.com/search?q=org%3AScoopInstaller+Expand-7zipArchive&type=code

This future can help a lot.

niheaven commented 2 years ago

The most use cases are NSIS installer (app-32, app-64), others like embedded chrome.7z or custom extraction actions (e.g., multi-archive, different extracting params, etc.). It may be useful in some cases, we will take into consideration this feature, thanks.

caoli5288 commented 2 years ago

@niheaven Any progress?

niheaven commented 2 years ago

Will check it after the upcoming release, sorry for waiting.

ghost commented 2 years ago

I having problem like this one, trying to create a manifest for HyperSQL (database for java) and in zip file there is nasted folder hsqldb-2.7.0/hsqldb/ and as you know "extract_dir": "hsqldb-2.7.0\\hsqldb\\" not working.

any solution for this one even temporarily is fine thank I'm appreciated it.

rashil2000 commented 2 years ago

Have you tried without the trailing slashes? i.e. "extract_dir": "hsqldb-2.7.0\\hsqldb"

ghost commented 2 years ago

It worked 💪🙏🏻🍻 @rashil2000