{
    "version": "2.5.0",
    "description": "A streaming media (audio/video) server which supports Ogg (Vorbis and Theora), Opus, WebM and MP3 streams.",
    "homepage": "https://icecast.org/",
    "license": "GPL-2.0-only",
    "url": "https://ftp.osuosl.org/pub/xiph/releases/icecast/icecast_win32_2.5.0.exe#/dl.7z",
    "hash": "087cba22a168bebda46b909b0f2b9e3a78b5cbe4eddb7f5d2f37af6025e4f39b",
    "suggest": {
        "nssm": "nssm"
    },
    "notes": [
        "To install IceCast as Windows service:",
        "(1) Install nssm",
        "(2) Run \"$dir\\install-service.bat\" under Admin"
    ],
    "pre_install": [
        "Remove-Item \"$dir\\`$PLUGINSDIR\", \"$dir\\Uninstall.exe\" -Force -Recurse",
        "'log\\access.log', 'log\\error.log', 'log\\playlist.log' | ForEach-Object {",
        "    if(!(Test-Path \"$persist_dir\\$_\")) { New-Item \"$dir\\$_\" -Force | Out-Null }",
        "}",
        "Set-Content \"$dir\\icecast-scoop-start.bat\" \"@echo off`r`ncd /d %~dp0`r`nicecast.bat\" -Encoding Ascii"
    ],
    "post_install": [
        "$cont = @(",
        "    '@echo off'",
        "    'where nssm >nul'",
        "    'if %ERRORLEVEL% neq 0 ('",
        "    '    echo ERROR: cannot find nssm in PATH. Please install nssm before running this script.'",
        "    '    exit /B'",
        "    ')'",
        "    \"nssm install IceCast `\"$dir\\icecast-scoop-start.bat`\"\"",
        "    'net start IceCast'",
        ")",
        "Set-Content \"$dir\\install-service.bat\" ($cont -join \"`r`n\") -Encoding Ascii",
        "Set-Content \"$dir\\uninstall-service.bat\"  \"@echo off`r`nsc delete IceCast\" -Encoding Ascii"
    ],
    "uninstaller": {
        "script": [
            "# if user uninstalls (but not updates) the app, then uninstall IceCast service",
            "if ($cmd -eq 'uninstall') {",
            "    $service = Get-Service 'IceCast' -ErrorAction SilentlyContinue",
            "    if ($service) {",
            "        if(!(is_admin)) { error 'Admin right is required to uninstall IceCast service'; break }",
            "        sc.exe delete IceCast",
            "    }",
            "}"
        ]
    },
    "bin": [
        [
            "icecast-scoop-start.bat",
            "icecast"
        ]
    ],
    "persist": [
        "admin",
        "log",
        "icecast.xml"
    ],
    "checkver": {
        "url": "https://icecast.org/download/",
        "regex": "Icecast Current Release \\(([\\d.]+)\\)"
    },
    "autoupdate": {
        "url": "https://ftp.osuosl.org/pub/xiph/releases/icecast/icecast_win32_$version.exe#/dl.7z"
    }
}
