Chocolatey: force install sysinternals after hash mismatch
Posted by jpluimers on 2021/09/28
Shortly after UltraVNC mismatching sha256 hash the chocolatey checksum check (Chocolatey: when upgrades or installs keep insisting the hash has changed, and over time the mismatch changes as well), I bumped into another occasion: now (because of a zero sized .nupkg file), I had to force reinstall sysinternals.
The problem however is that sysinternals chocolatey will always install the latest version as per [WayBack] Chocolatey Software | Sysinternals 2019.12.19
Notes
- This package supports only latest version.
- This package by default installs to tools directory which will create shims for all applications. When you install to different directory, shims are not created but directory is added to the PATH.
- This package downloads the nano edition of sysinternals suite when installing it on a nano server.
- To have GUI for the tools, install nirlauncher package and use
/Sysinternalspackage parameter.
It means that when reinstalling an older version (in the process of fixing a broken chocolatey install), it is OK to ignore the error caused during forced reinstall:
C:\bin\bin>choco install --force --yes sysinternals Chocolatey v0.10.15 Installing the following packages: sysinternals By installing you accept licenses for the packages. sysinternals v2019.6.29 already installed. Forcing reinstall of version '2019.6.29'. Please use upgrade if you meant to upgrade to a new version. Progress: Downloading sysinternals 2019.6.29... 100% sysinternals v2019.6.29 (forced) [Approved] sysinternals package files install completed. Performing other installation steps. Sysinternals Suite is going to be installed in 'C:\ProgramData\chocolatey\lib\sysinternals\tools' Downloading sysinternals from 'https://download.sysinternals.com/files/SysinternalsSuite.zip' Progress: 100% - Completed download of C:\Users\jeroenp\AppData\Local\Temp\chocolatey\sysinternals\2019.6.29\SysinternalsSuite.zip (29 MB). Download of SysinternalsSuite.zip (29 MB) completed. Error - hashes do not match. Actual value was 'AE0AB906A61234D1ECCB027D04F5A920D78A31494372193EE944DD419842625C'. ERROR: Checksum for 'C:\Users\jeroenp\AppData\Local\Temp\chocolatey\sysinternals\2019.6.29\SysinternalsSuite.zip' did not meet 'db59efe1739a2262104874347277f9faa0805a1a7a0acd9cc29e9544fb8040c5' 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. The install of sysinternals was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\sysinternals\tools\chocolateyInstall.ps1'. See log for details. Chocolatey installed 0/1 packages. 1 packages failed. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). Failures - sysinternals (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\sysinternals\tools\chocolateyInstall.ps1'. See log for details.
So in this case, as always the most recent Sysinternals file is used, it is OK to follow the bold guideline above (and quoted below) use the checksum for that file. You might even want to ignore it, as the file is downloaded over https so tampering is virtually impossible:
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.
For this checksum, the forced reinstall becomes choco install --force --yes sysinternals --checksum AE0AB906A61234D1ECCB027D04F5A920D78A31494372193EE944DD419842625C
Alternatively (with a slight chance of yet another checksum) would be choco install --force --yes sysinternals --ignore-checksums
Related:
- [WayBack] chocolatey-coreteampackages/Readme.md at master · chocolatey-community/chocolatey-coreteampackages · GitHub
sysinternals
The Sysinternals Troubleshooting Utilities have been rolled up into a single suite of tools. This file contains the individual troubleshooting tools and help files. It does not contain non-troubleshooting tools like the BSOD Screen Saver or NotMyFault.
Package parameters
/InstallDir– Installation directory, by default Chocolatey tools directory./InstallationPath– the same asInstallDir
Example:
choco install sysinternals --params "/InstallDir:C:\your\install\path"Notes
- This package supports only latest version.
- This package by default installs to tools directory which will create shims for all applications. When you install to different directory, shims are not created but directory is added to the PATH.
- This package downloads the nano edition of sysinternals suite when installing it on a nano server.
- To have GUI for the tools, install nirlauncher package and use
/Sysinternalspackage parameter.
- [WayBack] chocolatey-coreteampackages/chocolateyInstall.ps1 at master · chocolatey-community/chocolatey-coreteampackages · GitHub
$packageArgs = @{ packageName = 'sysinternals' url = 'https://download.sysinternals.com/files/SysinternalsSuite.zip' checksum = 'ae0ab906a61234d1eccb027d04f5a920d78a31494372193ee944dd419842625c' checksumType = 'sha256' unzipLocation = $installDir } - [WayBack] Chocolatey Software | Commandsinstall
... --ignorechecksum, --ignore-checksum, --ignorechecksums, --ignore-checksums IgnoreChecksums - Ignore checksums provided by the package. Overrides the default feature 'checksumFiles' set to 'True'. Available in 0.9.9.9+. ... --checksum, --downloadchecksum, --download-checksum=VALUE Download Checksum - a user provided checksum for downloaded resources for the package. Overrides the package checksum (if it has one). Defaults to empty. Available in 0.10.0+. --checksum64, --checksumx64, --downloadchecksumx64, --download-checksum-x64=VALUE Download Checksum 64bit - a user provided checksum for 64bit downloaded resources for the package. Overrides the package 64-bit checksum (if it has one). Defaults to same as Download Checksum. Available in 0.10.0+. ...
–jeroen






Leave a comment