chocolatey / checksum Goto Github PK
View Code? Open in Web Editor NEWValidates MD5/SHA1 CheckSums on the command line.
License: Apache License 2.0
Validates MD5/SHA1 CheckSums on the command line.
License: Apache License 2.0
I inserted a dvd in my D:\ drive I would like to know its hash
instead of just defaulting back to md5, throw an error if the type is specified wrong.
Switch to use .NET Framework 4.8, rather than the currently targeted 4.0.
Chocolatey CLI is moving to use .NET Framework 4.8, and checksum should be upgraded as well.
All tests, unit, integration, and Pester tests, all continue to work as expected.
N/A
As part of improvements to Chocolatey Software build processes, we're moving build definitions into code where possible.
This will allow us to import the build to any of the TeamCity servers we need to.
N/A
Replace the UppercuT build scripts with Cake or a similar tool that allows updated build tools.
The UppercuT build scripts are showing their age with being unable to work with newer versions of the .Net build process.
GitHub issue for Open Source Chocolatey
GitLab issue for Chocolatey Licensed Extension
build.bat
and test.bat
with new scripts.Package fails to validate or install because download is larger than 2GB
Chocolatey should be able to cope with large files for calculating checksum/filehash
Tried to install package with downloaded file larger than 2GB eg- https://community.chocolatey.org/packages/resharper-platform/241.0.20240528.180551
As per verifier environment
n/a
2024-06-10 01:03:39,185 4952 [INFO ] - Download of JetBrains.dotUltimate.2024.1.3.exe (2.55 GB) completed.
2024-06-10 01:03:42,544 4952 [DEBUG] - No runtime virus checking built into FOSS Chocolatey. Check out Pro/Business - https://chocolatey.org/compare
2024-06-10 01:03:42,637 4952 [DEBUG] - Verifying package provided checksum of '5342ede24c95a30261c0d43402c5cd3687d4b208233f028d7cb1ef7fe99a5a25' for 'C:\ProgramData\chocolatey\lib\resharper-platform\JetBrains.dotUltimate.2024.1.3.exe'.
2024-06-10 01:03:42,793 4952 [DEBUG] - Running Get-ChecksumValid -file 'C:\ProgramData\chocolatey\lib\resharper-platform\JetBrains.dotUltimate.2024.1.3.exe' -checksum '5342ede24c95a30261c0d43402c5cd3687d4b208233f028d7cb1ef7fe99a5a25' -checksumType 'sha256' -originalUrl 'https://download.jetbrains.com/resharper/dotUltimate.2024.1.3/JetBrains.dotUltimate.2024.1.3.exe'
2024-06-10 01:03:43,091 4952 [DEBUG] - checksum.exe found at 'C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe'
2024-06-10 01:03:43,123 4952 [DEBUG] - Executing command ['C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe' -c="5342ede24c95a30261c0d43402c5cd3687d4b208233f028d7cb1ef7fe99a5a25" -t="sha256" -f="C:\ProgramData\chocolatey\lib\resharper-platform\JetBrains.dotUltimate.2024.1.3.exe"]
2024-06-10 01:40:08,840 4952 [WARN ] - Chocolatey timed out waiting for the command to finish. The timeout
specified (or the default value) was '2700' seconds. Perhaps try a
higher `--execution-timeout`? See `choco -h` for details.
2024-06-10 01:40:08,888 4952 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2024-06-10 01:40:09,955 4952 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
2024-06-10 01:40:10,683 4952 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\resharper-platform'
2024-06-10 01:40:10,745 4952 [WARN ] - Error computing hash for 'C:\ProgramData\chocolatey\lib\resharper-platform\JetBrains.dotUltimate.2024.1.3.exe'
Hash will be special code for locked file or file too big instead.
Captured error:
The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.
### Additional Context
_No response_
I was trying to simply use the first of only two real mandatory switches - the file path:
C:\temp> checksum --hashtype=sha256 -f="c:\temp\rhash-1.3.5-1-win64.zip"
-f=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum -f="c:\temp\rhash-1.3.5-1-win64.zip"
-f=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum --file="c:\temp\rhash-1.3.5-1-win64.zip"
--file=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum --file='c:\temp\rhash-1.3.5-1-win64.zip'
--file=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum --file=c:\temp\rhash-1.3.5-1-win64.zip
--file=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
...and then I read the "parse_arguments_and_set_up_configuration" code and see that you have not coded handling the path (yet?).
Then I just wanted to hash SHA256, so I try the second switch:
C:\temp> checksum .\rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum .\rhash-1.3.5-1-win64.zip -t sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum .\rhash-1.3.5-1-win64.zip -t=sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum .\rhash-1.3.5-1-win64.zip -t 'sha256'
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum --hashtype=sha256 rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum --hashtype=sha256 -f=rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype=sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype="sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype "sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip -t sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip -t "sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip -t="sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
....and then after fighting with it, I jumped back here and read the code for the "parse_arguments_and_set_up_configuration" method and immediately saw that you simply have not coded any handling for the hash type (yet?)......not sure the status of this little util but you may want to just note in the util's help and/or the readme that it only currently computes MD5 and the switches do not work and maybe a mention of whether there are plans to do so etc.
It looked like a cool quick console util that does what some of my PS module functions do so figured it could come in handy. Maybe if I get some time I can do a quick pull and help you finish it. :(
Checksum is stripping apostrophe(s) from file paths, and therefore not finding the file to checksum.
That checksum.exe will work on file paths that contain apostrophe(s).
Mark's
and it to an administrator accountMark's
choco install 4k-video-downloader
Verifying package provided checksum of 'bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47' for 'C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI'.
Running Get-ChecksumValid -file 'C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI' -checksum 'bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47' -checksumType 'sha256' -originalUrl 'https://dl.4kdownload.com/app/4kvideodownloader_4.20.4_x64.msi?source=chocolatey'
checksum.exe found at 'C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe'
Executing command ['C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe' -c="bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47" -t="sha256" -f="C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI"]
File 'C:\Users\Marks\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI' doesn't exist.
Command ['C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe' -c="bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47" -t="sha256" -f="C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI"] exited with '1'.
ERROR: Checksum for 'C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI' did not meet 'bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
at Get-ChecksumValid, C:\ProgramData\chocolatey\helpers\functions\Get-CheckSumValid.ps1: line 210
at Get-ChocolateyWebFile, C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyWebFile.ps1: line 385
at Install-ChocolateyPackage, C:\ProgramData\chocolatey\helpers\functions\Install-ChocolateyPackage.ps1: line 402
at <ScriptBlock>, C:\ProgramData\chocolatey\lib\4k-video-downloader\tools\chocolateyinstall.ps1: line 25
at <ScriptBlock>, C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 49
at <ScriptBlock>, <No file>: line 1
As part of submitting a package to the Chocolatey Community Repository, a reasonably new requirement is that if it is an embedded package, that it contains a VERIFICATION.txt file, explaining how the binary files can be verified.
This wasn't in place that last time we pushed checksum to the CCR, so we need to get this added., otherwise, it can't be approved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.