unhandled exception with Get-ChocolateyUnzip
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
### What You Are Seeing?
Unhandled exception when an "improper" zip file includes the drive letter in the internal package. (IOW, the single zipped file path includes `C:\\`.)
This doesn't occur on all machines. 7zip doesn't care and converts the ":" into "_", but "combining" the unzipped file path (as 7zip provides) with the `destination` path causes the crash.
### What is Expected?
Chocolatey doesn't care either.
### How Did You Get This To Happen? (Steps to Reproduce)
I can't, but a user does by attempting to install miktex.install using `cinst miktex.install`.
### Output Log
https://github.com/teknowledgist/Chocolatey-packages/files/5771356/chocolatey.log
### Additional comments
The [issue is discussed here](https://github.com/teknowledgist/Chocolatey-packages/issues/45). In some sense it is a problem with the package, but there isn't any reason why other packages couldn't have "improper" zip files also.
The user has Chocolatey Business. Does that flavor combine the `destination` string and unzipped string as *paths* (i.e. with a `Join-Path`-like .NET call) instead of as strings as the OSS flavor does?
I thought [the 'e' option discussed here](https://github.com/chocolatey/choco/issues/1824) would be a solution, but 7zip returns the full path when that is used too.
Thanks.
Contributor guide
Research direction
Start at the Get-ChocolateyUnzip entry point and inspect how the destination is combined with the path returned by 7zip. Use the miktex.install scenario and attached chocolatey.log as the reproduction reference; done means an internal path containing a drive letter no longer causes an unhandled exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100