{
    "version": "2.52.5",
    "description": "Photo viewer, image resizer & batch converter",
    "homepage": "https://www.xnview.com/en/xnview-classic/",
    "license": "Freeware|Proprietary",
    "url": "https://download.xnview.com/XnView-win-full.zip",
    "hash": "5df81ce077e649e95fcb85443c298720c4f0684cc265315424cf49a74e13d71d",
    "extract_dir": "XnView",
    "pre_install": [
        "# --- If xnview.ini exists as a folder, then remove it ---",
        "if (Test-Path \"$persist_dir\\xnview.ini\" -PathType Container) {",
        "    Remove-Item \"$persist_dir\\xnview.ini\" -Force -Recurse",
        "}",
        "if (!(Test-Path \"$persist_dir\\xnview.ini\")) {",
        "   New-Item \"$dir\\xnview.ini\" -ItemType File | Out-Null",
        "}"
    ],
    "uninstaller": {
        "script": [
            "# Manually copy because Xnview overwrites hardlink with a regular file, which breaks persist",
            "if ((Test-Path \"$dir\\xnview.ini\") -and !(Get-Item \"$dir\\xnview.ini\").LinkType -and (Test-Path $persist_dir)) { Copy-Item \"$dir\\xnview.ini\" $persist_dir -Force }"
        ]
    },
    "bin": "xnview.exe",
    "shortcuts": [
        [
            "xnview.exe",
            "XnView"
        ]
    ],
    "persist": "xnview.ini",
    "checkver": "Download <strong>XnView ([\\d.]+)",
    "autoupdate": {
        "url": "https://download.xnview.com/XnView-win-full.zip",
        "hash": {
            "url": "https://www.xnview.com/en/xnview-classic/",
            "regex": "$basename:\\s+$sha256"
        }
    }
}
