{
    "version": "10.07.0",
    "description": "An interpreter for the PostScript language and for PDF",
    "homepage": "https://www.ghostscript.com",
    "license": {
        "identifier": "AGPL-3.0-or-later|Freeware",
        "url": "https://www.ghostscript.com/license.html"
    },
    "architecture": {
        "64bit": {
            "url": "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10070/gs10070w64.exe#/dl.7z",
            "hash": "sha512:ccee91cc0a7ae7b9413e7d3b4354a49530eae2ebb8e968d8af9115aaa02f6cea2efb10a86d6fc43597b50a18d0ba4c7bfa49a551ea485cab5f8ca26009be3f8b",
            "bin": [
                "bin\\gswin64.exe",
                "bin\\gswin64c.exe",
                [
                    "bin\\gswin64c.exe",
                    "gs"
                ]
            ]
        },
        "32bit": {
            "url": "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10070/gs10070w32.exe#/dl.7z",
            "hash": "sha512:8472a405b7ffad52a470e44003c8fcb43b36cced1d385048b6849f6f6b6f802e0a645ebb353fcb908d19cf75c0c4de31de5189c48c101ba030f2fd1ba31f0d64",
            "bin": [
                "bin\\gswin32.exe",
                "bin\\gswin32c.exe",
                [
                    "bin\\gswin32c.exe",
                    "gs"
                ]
            ]
        }
    },
    "post_install": [
        "$reg_app = \"HKCU:\\SOFTWARE\\Artifex\\GPL Ghostscript\\$version\"",
        "$reg_lib = \"HKCU:\\SOFTWARE\\GPL Ghostscript\\$version\"",
        "if ($global) { $reg_app = $reg_app.Replace('HKCU:','HKLM:'); $reg_lib = $reg_lib.Replace('HKCU:','HKLM:') }",
        "$reg_gs_dll = \"$dir\\bin\\gsdll$($architecture.Replace('bit', '')).dll\".Replace('\\','\\\\')",
        "$reg_gs_lib = \"$dir\\bin;$dir\\lib;$dir\\fonts\".Replace('\\','\\\\')",
        "New-Item -Path $reg_app -Value $dir.Replace('\\','\\\\') -Force | Out-Null",
        "New-Item -Path $reg_lib -Value $dir.Replace('\\','\\\\') -Force | Out-Null",
        "New-ItemProperty -Path $reg_lib -Name 'GS_DLL' -Value $reg_gs_dll -PropertyType String | Out-Null",
        "New-ItemProperty -Path $reg_lib -Name 'GS_LIB' -Value $reg_gs_lib -PropertyType String | Out-Null"
    ],
    "env_add_path": "lib",
    "post_uninstall": [
        "$reg_app = \"HKCU:\\SOFTWARE\\Artifex\\GPL Ghostscript\"",
        "$reg_lib = \"HKCU:\\SOFTWARE\\GPL Ghostscript\"",
        "if ($global) { $reg_app = $reg_app.Replace('HKCU:','HKLM:'); $reg_lib = $reg_lib.Replace('HKCU:','HKLM:') }",
        "Remove-Item -Path $reg_app -Force -Recurse",
        "Remove-Item -Path $reg_lib -Force -Recurse"
    ],
    "checkver": {
        "url": "https://www.ghostscript.com/releases/index.html",
        "regex": "latest release is Ghostscript ([\\d.]+)"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$cleanVersion/gs$cleanVersionw64.exe#/dl.7z"
            },
            "32bit": {
                "url": "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$cleanVersion/gs$cleanVersionw32.exe#/dl.7z"
            }
        },
        "hash": {
            "url": "$baseurl/SHA512SUMS"
        }
    }
}
