checksum.exe can't find file while running in System Context
Checklist
- [x] I confirm there are no unresolved issues reported on the Chocolatey Status page.
- [x] I have verified this is the correct repository for opening this issue.
- [x] I have verified no other issues exist related to my problem.
- [x] I have verified this is not an issue for a specific package.
- [x] I have verified this issue is not security related.
- [x] I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
While using chocolatey with Powershell DSC (System Context) to deploy packages (e.g. 7zip) the function Get-ChecksumValid crashes because checksum.exe doesn't find the installer file. This file is located in "C:\Windows\system32\config\systemprofile\AppData\Local\Temp\PACKAGENAME\VERSION"
If I use Get-Filehash or Test-Path in the same user context (as SYSTEM) the file can be found. When I try to use checksum.exe with the exact same Path, it says: File 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\7zip\25.0.0\7z2500-x64.msi' doesn't exist.
When I try to install the package interactively with choco install, it works.
What is Expected?
checksum.exe finds the install file and returns the filehash correctly.
How Did You Get This To Happen?
- Deploying 7zip with Powershell DSC Resource cChoco.
OR
- Start Powershell in SYSTEM Context (PSExec)
- Change Directory to C:\ProgramData\chocolatey\tools
.\checksum.exe 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\7zip\25.0.0\7z2500-x64.msi'
System Details
- Operating System: Windows Server 2022
- Windows PowerShell version: 5.1.20348.3932
- Chocolatey CLI Version: 2.5.0
- Chocolatey Licensed Extension version:
- Chocolatey License type: Free
- Terminal/Emulator: Powershell
Installed Packages
7zip 24.9.0
chocolatey 2.5.0
chocolatey-compatibility.extension 1.0.0
chocolatey-core.extension 1.4.0
chocolatey-dotnetfx.extension 1.0.1
ChromeDriver 138.0.7204.183
GoogleChrome 138.0.7204.184
MicrosoftVisualCRedist 14.42.34433
NotepadPlusPlus 8.8.3
NuGetProviderDll 1.0.0
PowerShell 7.5.1
Output Log
2025-08-05 15:13:36,951 21680 [DEBUG] - Command ['C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe' -c="b48e905ed02c530638e6173f2d743668e63561aac1914d2723fbee5690792272" -t="sha256" -f="C:\Windows\system32\config\systemprofile\AppData\Local\Temp\7zip\25.0.0\7z2500-x64.msi"] exited with '1'.
2025-08-05 15:13:36,955 21680 [ERROR] - ERROR: Checksum for 'C:\Windows\system32\config\systemprofile\AppData\Local\Temp\7zip\25.0.0\7z2500-x64.msi' did not meet 'b48e905ed02c530638e6173f2d743668e63561aac1914d2723fbee5690792272' 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 215
at Get-ChocolateyWebFile, C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyWebFile.ps1: line 421
at Install-ChocolateyPackage, C:\ProgramData\chocolatey\helpers\functions\Install-ChocolateyPackage.ps1: line 407
at <ScriptBlock>, C:\ProgramData\chocolatey\lib\7zip\tools\chocolateyinstall.ps1: line 22
at <ScriptBlock>, C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 63
at <ScriptBlock>, <No file>: line 1
Additional Context
No response