{
    "##": "Lynx declares that it requires Win32/32bit OpenSSL 3.0.x lib.",
    "version": "2.9.2",
    "description": "Text web browser.",
    "homepage": "https://invisible-island.net/lynx/lynx.html",
    "license": "GPL-2.0-only",
    "notes": "Version 2.8.3 was moved to 'version/lynx283'",
    "depends": "cacert",
    "suggest": {
        "vcredist": "extras/vcredist2022"
    },
    "innosetup": true,
    "url": "https://invisible-island.net/archives/lynx/current/lynx-newssl2.9.2-setup.exe",
    "hash": "12165dfb4e0608a7cd25a088e439a64b6573fff07c32757e989211a04d3b20d7",
    "pre_install": [
        "if (-not (installed cacert)) { throw 'cacert is required but not installed. Please install cacert first.' }",
        "if (-not (Test-Path \"$persist_dir\\lynx.cfg\")) {",
        "    $global_cacert = installed cacert $true",
        "    Add-Content \"$dir\\lynx.cfg\" -Value @(\"SSL_CERT_FILE:`\"$(appdir cacert $global_cacert)\\current\\cacert.pem`\"\", \"FORCE_SSL_PROMPT:PROMPT\") -Encoding Ascii",
        "}",
        "",
        "# Get the latest OpenSSL 3.0.x for Win32/32bit from slproweb/opensslhashes",
        "$result = Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/slproweb/opensslhashes/refs/heads/master/win32_openssl_hashes.json'",
        "$openssl_info = $result.files.PSObject.Properties | Where-Object {",
        "    $_.Value.light -eq $true -and",
        "    $_.Value.installer -eq 'exe' -and",
        "    $_.Value.bits -eq '32' -and",
        "    $_.Value.arch -eq 'INTEL' -and",
        "    $_.Value.basever -like '3.0.*'",
        "} | Sort-Object -Property basever -Descending | Select-Object -First 1 -ExpandProperty Value",
        "info \"Downloading OpenSSL v$($openssl_info.basever) ...\"",
        "Invoke-WebRequest -Uri $openssl_info.url -OutFile \"$dir\\openssl.exe\"",
        "if (-not (Test-Path \"$dir\\openssl.exe\")) { throw 'Failed to download OpenSSL.' }",
        "Expand-InnoArchive -Path \"$dir\\openssl.exe\" -DestinationPath $dir -Removal"
    ],
    "bin": [
        [
            "lynx.exe",
            "lynx",
            "-cfg=\"$dir\\lynx.cfg\""
        ]
    ],
    "shortcuts": [
        [
            "lynx.exe",
            "lynx",
            "-cfg=\"$dir\\lynx.cfg\""
        ]
    ],
    "persist": [
        "lynx.cfg",
        "lynx.lss"
    ],
    "checkver": {
        "url": "https://lynx.invisible-island.net/current/CHANGES",
        "regex": "[\\d-]{10}\\s+\\(([\\w.]+)\\)"
    },
    "autoupdate": {
        "url": "https://invisible-island.net/archives/lynx/current/lynx-newssl$version-setup.exe"
    }
}
