Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autoupdate): Update array of arrays correctly #4502

Merged
merged 1 commit into from
Nov 8, 2021

Conversation

niheaven
Copy link
Member

@niheaven niheaven commented Nov 8, 2021

Hotfix for #3518, support updating array of arrays correctly.

GIMP - autoupdate `bin` and `shortcuts`
{
    "version": "2.10.28",
    "description": "GNU Image Manipulation Program",
    "homepage": "https://www.gimp.org",
    "license": "GPL-3.0-only",
    "url": "https://download.gimp.org/mirror/pub/gimp/v2.10/windows/gimp-2.10.28-setup.exe",
    "hash": "2c2e081ce541682be1abdd8bc6df13768ad9482d68000b4a7a60c764d6cec74e",
    "innosetup": true,
    "installer": {
        "script": [
            "Push-Location \"$dir\"",
            "Get-ChildItem -Filter '*.debug' -Recurse | Remove-Item -Recurse",
            "if ($architecture -eq '64bit') {",
            "   Rename-Item 'lib\\gimp\\2.0\\plug-ins\\twain\\twain,3.exe' 'twain.exe'",
            "   Remove-Item 'lib\\gimp\\2.0\\plug-ins\\twain\\twain,1.exe'",
            "   Get-ChildItem -Filter '*,1*' -Recurse | Rename-Item -NewName { $_.name -Replace ',\\d','' }",
            "   Get-ChildItem -Filter '*,*' -Recurse | Remove-Item",
            "} else {",
            "   Rename-Item 'lib\\gimp\\2.0\\plug-ins\\twain\\twain,1.exe' 'twain.exe'",
            "   Remove-Item 'lib\\gimp\\2.0\\plug-ins\\twain\\twain,3.exe'",
            "   Get-ChildItem -Filter '*,1*' -Recurse | Remove-Item",
            "   Get-ChildItem -Filter '*,*' -Recurse | Rename-Item -NewName { $_.name -Replace ',\\d','' }",
            "}",
            "$defpath = \"`nPATH=`${gimp_installation_dir}\\bin`n\"",
            "$defenv = Get-Content 'lib\\gimp\\2.0\\environ\\default.env' -Raw",
            "$defenv += $defpath",
            "$defenv += \"PYTHONPATH=`${gimp_installation_dir}\\lib\\gimp\\2.0\\python;`${gimp_plug_in_dir}\\plug-ins\\python-console\"",
            "$defenv | Set-Content 'lib\\gimp\\2.0\\environ\\default.env'",
            "$pyenv = Get-Content 'lib\\gimp\\2.0\\environ\\pygimp.env' -Raw",
            "$pyenv + '__COMPAT_LAYER=HIGHDPIAWARE' | Set-Content 'lib\\gimp\\2.0\\environ\\pygimp.env'",
            "$pyint = Get-Content 'lib\\gimp\\2.0\\interpreters\\pygimp.interp' -Raw",
            "$pyint = ($pyint -Replace '/mingw32', \"$dir\\bin\") -Replace 'py::python2', 'py::python'",
            "$pyint | Set-Content 'lib\\gimp\\2.0\\interpreters\\pygimp.interp'",
            "Pop-Location"
        ]
    },
    "bin": [
        "bin\\gimp-console-2.10.exe",
        [
            "bin\\gimp-console-2.10.exe",
            "gimp-console"
        ],
        [
            "bin\\gimp-console-2.10.exe",
            "gimp"
        ],
        "bin\\gimptool-2.0.exe",
        [
            "bin\\gimptool-2.0.exe",
            "gimptool"
        ]
    ],
    "shortcuts": [
        [
            "bin\\gimp-2.10.exe",
            "GIMP"
        ]
    ],
    "persist": [
        "etc\\gimp",
        "share\\gimp"
    ],
    "checkver": {
        "url": "https://www.gimp.org/downloads/",
        "regex": "gimp-(?<version>[\\d.]+)-setup(?<build>-\\d)?\\.exe",
        "replace": "${version}${build}"
    },
    "autoupdate": {
        "url": "https://download.gimp.org/mirror/pub/gimp/v$majorVersion.$minorVersion/windows/gimp-$matchHead-setup$matchTail.exe",
        "hash": {
            "url": "$baseurl/SHA256SUMS"
        },
        "bin": [
            "bin\\gimp-console-$majorVersion.$minorVersion.exe",
            [
                "bin\\gimp-console-$majorVersion.$minorVersion.exe",
                "gimp-console"
            ],
            [
                "bin\\gimp-console-$majorVersion.$minorVersion.exe",
                "gimp"
            ],
            "bin\\gimptool-$majorVersion.0.exe",
            [
                "bin\\gimptool-$majorVersion.0.exe",
                "gimptool"
            ]
        ],
        "shortcuts": [
            [
                "bin\\gimp-$majorVersion.$minorVersion.exe",
                "GIMP"
            ]
        ]
    }
}

@niheaven
Copy link
Member Author

niheaven commented Nov 8, 2021

Hi @ScoopInstaller/maintainers, since this is just a hotfix of #3518, I'll merge it into develop directly and please test the brand-new autoupdate feature (now you can auto update almost everything and can update multiple items).

@niheaven niheaven merged commit 1490869 into ScoopInstaller:develop Nov 8, 2021
@niheaven niheaven deleted the fix-au branch November 8, 2021 11:55
@Ash258 Ash258 mentioned this pull request Dec 13, 2022
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant