{
    "version": "1.2.12",
    "description": "Massively spiffy yet delicately unobtrusive compression library. Unencumbered by patents.",
    "homepage": "http://www.zlib.net/",
    "license": "Zlib",
    "url": "https://raw.githubusercontent.com/ScoopInstaller/Binary/master/zlib/zlib-1.2.12-windows-32bit-vc14.2.7z",
    "hash": "0d7245a2e499320cb4803b3889df8a9051d2dfc0c53d2908a3d99b687943c68b",
    "notes": [
        "For CMake (and other build tools) to find this installation of zlib, run:",
        "\"$dir\\register.reg\""
    ],
    "post_install": [
        "$dirpath = \"$dir\".Replace('\\', '\\\\')",
        "'register', 'unregister' | ForEach-Object {",
        "  if (Test-Path \"$bucketsdir\\extras\\scripts\\zlib\\$_.reg\") {",
        "    $content = Get-Content \"$bucketsdir\\extras\\scripts\\zlib\\$_.reg\"",
        "    $content = $content.Replace('$dir', $dirpath)",
        "    $content | Set-Content -Path \"$dir\\$_.reg\"",
        "  }",
        "}"
    ],
    "pre_uninstall": [
        "if ($cmd -eq 'uninstall') {",
        "    $key = Get-ItemProperty -Path 'HKLM:\\SOFTWARE\\GnuWin32\\Zlib' -Name 'InstallPath' -ErrorAction SilentlyContinue",
        "    if ($key -and $key.InstallPath.Contains('apps\\zlib\\current')) {",
        "        if (!(is_admin)) { error \"$app requies admin rights to unregister the installation path\"; break }",
        "        Invoke-ExternalCommand reg -ArgumentList @('import', \"$dir\\unregister.reg\") -RunAs | Out-Null",
        "    }",
        "}"
    ]
}
