-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
decompress.ps1: Rewrite extract_xxx functions #3204
Conversation
Could you add more tests to increase the test coverage of the decompress functionality? Such as extracting .tar.*, etc. |
I'm trying to, but further test cases need 7zip, lessmsi, innounp (and maybe dark?). I'm not sure appveyor could install these tools just for testing. If it could, I could add more. Otherwise, I would try to seperate some function except for actually extraction for testing param passthru. |
7-Zip 18.05 is available on Appveyor: https://www.appveyor.com/docs/windows-images-software/#tools |
You could always use scoop installing as backup plan, if there is no better solution. Create the last test case in which you just do something like |
It's better to use scoop installed 7zip lessmsi and innounp, since |
I'll try to make some more test cases. |
Just downloads https://ci.appveyor.com/project/lukesampson/scoop/builds/23155191/job/ij3b30cvq9as63hk |
df1d165
to
5c75413
Compare
Sorry for so many force-push, I've tested CI with installing tools by scoop and achieved the goal with a simplified Now I could add more test cases with these installed tools. PS. I'm not familiar with Pester's |
3390bed
to
7fd9c2b
Compare
Is it all? SideNote: Could you look into ScoopInstaller/Extras#2021 (comment) in next PR? Edit Expand-7zip function with some optional |
It should be enough for a single PR. I'll add some universal exe unpacker functions in the next PR, and check the commit for NSIS unpacker. |
Tested:
|
Thanks, will you do more tests on it? |
I don't think so. I would put it into wild. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Could you please adopt deprecation warning to old functions (extract_7z, ..) after #3341 is merged?? Just merge master and add `Show-DeprecationMessage $MyInvocation 'New-Name' |
Okay, let's move on. |
@niheaven some of the tests are failing |
Also |
@r15ch13 Thanks, I'm not familliar with Pester... |
ref: ScoopInstaller/Extras#2021 (comment), #3204 (comment) - Add new param `Overwrite` to `Expand-7ZipArchive`, with following values - "All": 7z param `-aoa`, overwrite All existing files without prompt, behave the same with default - "Skip": 7z param `-aos`, Skip extracting of existing files - "Rename": 7z param `-aou`, aUto rename extracting file - Add new param `Switches` to `Expand-7ZipArchive` and `Expand-InnoArchive` - It could pass all unrecognized params to `7z` and `innounp` - Patch `extract_7zip` and `unpack_inno` to adapt to `Expand-XXX` Usage: ScoopInstaller/Extras#2021, ScoopInstaller/Extras#2070
- The main bucket of Scoop has been separated to https://github.com/ScoopInstaller/Main - Requires PowerShell 5 and newer #3330 - Improve and refactor decompression functions #3204 #3409 #3411 - Move scoop config from `~\.scoop` to `~\.config\scoop\config.json` #3242 - Add `scoop hold` and `scoop unhold` for excluding programs from updates #3444 - Refactored some Core functions #3314 #3416 - Small fix for starting processes on Windows 7 #3415 Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com> Co-authored-by: Chawye Hsu <h404bi@outlook.com> Co-authored-by: Jakub Čábera <cabera.jakub@gmail.com>
PART II of #3169
lessmsi_config
,extract_lessmsi
intoextract_msi
(unique function, switch byMSIEXTRACT_USE_LESSMSI
)unpack_inno
toextract_inno
and handle InnoSetup indl_urls
withextract_inno
Expand-Zipfile
function in scoopinstaller/install as newextract_zip
&(file_path 7zip 7z.exe)
instead of7z
shim to avoid error caused byscoop install 7zip 7zip-zstd; scoop uninstall 7zip-zstd
extract_xxx
now have similar params ($path, $to, $recurse
)depends.ps1
Test Cases are as follow:
Please test and review. @r15ch13 @rasa @Ash258 @h404bi
PS. After merge, this PR will fix #3120, fix #3198, fix #3287, fix #3230, fix #3080, fix #3374, fix #3339, fix #3388