Skip to content

[Bug] checkver.ps1 not using Github Mode for hashes if URL contains fragment #6474

@w4tchdoge

Description

@w4tchdoge

Bug Report

Current Behavior

Running checkver.ps1 -u on a manifest where the url properties contain a fragment for renaming the downloaded file cannot find the Github provided hash for the downloaded file.

Expected Behavior

checkver.ps1 -u can find the Github provided hash for the downloaded file even if the manifest uses a fragment to rename the downloaded file.

Additional context/output

I'm trying to make a manifest (available below) for my own scoop bucket and while using checkver.ps1 to test if autoupdate works correctly I noticed that it wasn't using Github Mode to update the hashes.

Console output
..\bin\checkver.ps1 hellbombscript -u
hellbombscript: 3.6 (scoop version is 3.5) autoupdate available
Autoupdating hellbombscript
Could not find hash in https://api.github.com/repos/helldivers2fixes/HellbombScript/releases
Downloading Hellbomb.Script.v36.exe to compute hashes!
Hellbomb.Script.v36.exe (318.5 KB) [====================================================================================] 100%
Computed hash: bddb0b14f4052f0cb6145ca0e0b7c387a740ffc08f1142eeee890734d09997e6
Writing updated hellbombscript manifest

I compared my manifest to the manifest for peerbanhelper which was linked in #6416 and noticed that mine uses the fragment feature to rename the downloaded file to #/Hellbomb.Script.exe while peerbanhelper does not. I changed the manifest I'm working on to remove the fragment and ran checkver again and it used Github Mode to update the hash.

Console output
..\bin\checkver.ps1 hellbombscript -u
hellbombscript: 3.6 (scoop version is 3.5) autoupdate available
Autoupdating hellbombscript
Found: bddb0b14f4052f0cb6145ca0e0b7c387a740ffc08f1142eeee890734d09997e6 using Github Mode
Writing updated hellbombscript manifest
Manifest
{
    "version": "3.5",
    "description": "An application to troubleshoot Helldivers 2",
    "homepage": "https://github.com/helldivers2fixes/HellbombScript",
    "license": "MIT",
    "architecture": {
        "64bit": {
            "url": "https://github.com/helldivers2fixes/HellbombScript/releases/download/v3.5/Hellbomb.Script.v35.exe#/Hellbomb.Script.exe",
            "hash": "22a537dc88cfa45d192c49f5b3a08fd98accd90809622c51a0c657e233efb2e1"
        }
    },
    "bin": "Hellbomb.Script.exe",
    "shortcuts": [
        [
            "Hellbomb.Script.exe",
            "Hellbomb Script (Helldivers 2 Troubleshooter)"
        ]
    ],
    "checkver": "github",
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://github.com/helldivers2fixes/HellbombScript/releases/download/v$version/Hellbomb.Script.v$cleanVersion.exe#/Hellbomb.Script.exe"
            }
        }
    }
}

Possible Solution

I ran checkver.ps1 in debug mode and one of the debug lines shows that the jsonpath string includes the fragment.

Console output
$env:SCOOP_DEBUG = 'true'; ..\bin\checkver.ps1 hellbombscript -u
hellbombscript: 3.6 (scoop version is 3.5) autoupdate available
Autoupdating hellbombscript
DEBUG[1756726617] [$updatedProperties] = [url hash] -> C:\Scoop\apps\scoop\current\lib\autoupdate.ps1:491:5
DEBUG[1756726617] $substitutions (hashtable) -> C:\Scoop\apps\scoop\current\lib\autoupdate.ps1:221:5
DEBUG[1756726617] $substitutions.$buildVersion
DEBUG[1756726617] $substitutions.$match1                        3.6
DEBUG[1756726617] $substitutions.$cleanVersion                  36
DEBUG[1756726617] $substitutions.$matchTail
DEBUG[1756726617] $substitutions.$baseurl                       https://github.com/helldivers2fixes/HellbombScript/releases/download/v3.6
DEBUG[1756726617] $substitutions.$patchVersion
DEBUG[1756726617] $substitutions.$url                           https://github.com/helldivers2fixes/HellbombScript/releases/download/v3.6/Hellbomb.Script.v36.exe
DEBUG[1756726617] $substitutions.$dashVersion                   3-6
DEBUG[1756726617] $substitutions.$basenameNoExt                 Hellbomb.Script.v36
DEBUG[1756726617] $substitutions.$version                       3.6
DEBUG[1756726617] $substitutions.$underscoreVersion             3_6
DEBUG[1756726617] $substitutions.$matchHead                     3.6
DEBUG[1756726617] $substitutions.$minorVersion                  6
DEBUG[1756726617] $substitutions.$dotVersion                    3.6
DEBUG[1756726617] $substitutions.$preReleaseVersion             3.6
DEBUG[1756726617] $substitutions.$urlNoExt                      https://github.com/helldivers2fixes/HellbombScript/releases/download/v3.6/Hellbomb.Script.v36
DEBUG[1756726617] $substitutions.$basename                      Hellbomb.Script.v36.exe
DEBUG[1756726617] $substitutions.$majorVersion                  3
DEBUG[1756726617] $hashfile_url = $null -> C:\Scoop\apps\scoop\current\lib\autoupdate.ps1:224:5
DEBUG[1756726618] $jsonpath = $..assets[?(@.browser_download_url == 'https://github.com/helldivers2fixes/HellbombScript/releases/download/v3.6/Hellbomb.Script.v36.exe#/Hellbomb.Script.exe')].digest -> C:\Scoop\apps\scoop\current\lib\autoupdate.ps1:132:5
Could not find hash in https://api.github.com/repos/helldivers2fixes/HellbombScript/releases
Downloading Hellbomb.Script.v36.exe to compute hashes!
Loading Hellbomb.Script.v36.exe from cache
Computed hash: bddb0b14f4052f0cb6145ca0e0b7c387a740ffc08f1142eeee890734d09997e6
Writing updated hellbombscript manifest

Digging through to what printed that debug message and it might be that the $url variable used here in autoupdate.ps1 might not have the fragment removed/stripped?

System details

Windows version: Windows 11 24H2 (OS build 26100.4946)

OS architecture: 64bit

PowerShell version: 7.5.2

Additional software:

Scoop Configuration

{
  "last_update": "2025-09-01T11:34:44.4719733+08:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master",
  "root_path": "C:\\Scoop",
  "alias": {
    "infov": "scoop-infov",
    "ssearch": "scoop-ssearch",
    "upgrade": "scoop-upgrade",
    "listupd": "scoop-listupd",
    "ariaon": "scoop-ariaon",
    "ariaoff": "scoop-ariaoff",
    "ariawarnoff": "scoop-ariawarnoff",
    "ariawarnon": "scoop-ariawarnon"
  },
  "aria2-enabled": true,
  "aria2-warning-enabled": false,
  "cat_style": "default,-header-filename,-numbers",
  "aria2-options": "--max-overall-download-limit=256K",
  "aria2-min-split-size": "1M"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions