{
    "version": "9.7.25.29417",
    "description": "An instant messaging tool that gives you the best way to keep in touch with your friends and family.",
    "homepage": "https://im.qq.com",
    "license": {
        "identifier": "Proprietary",
        "url": "https://ti.qq.com/agreement/index.html"
    },
    "notes": [
        "Scoop doesn't persist your QQ data, by default they are stored in:",
        "'%UserProfile%\\Documents\\Tencent Files'.",
        "Files produced at runtime are left in '%AppData%\\Tencent'."
    ],
    "url": "https://dldir1.qq.com/qqfile/qq/PCQQ9.7.25/QQ9.7.25.29417.exe#/dl.7z",
    "hash": "804a72f08e692a6317abb31445990e4ddc66dbc163967b5d0c4db360b250ae05",
    "shortcuts": [
        [
            "Bin\\QQScLauncher.exe",
            "QQ"
        ]
    ],
    "installer": {
        "script": [
            "Get-Item \"$dir\\*\" -Exclude .rsrc | Remove-Item",
            "Expand-7zipArchive \"$dir\\.rsrc\\2052\\MSI\\101\" \"$dir\" -ExtractDir 'Files'",
            "Expand-7zipArchive \"$dir\\.rsrc\\2052\\MSI\\102\" \"$dir\\temp\"",
            "'vcruntime140.dll', 'msvcp140.dll', 'msvcr100.dll', 'vcomp140.dll', 'msvcp100.dll' | ForEach-Object {",
            "  Move-Item \"$dir\\temp\\$_\" \"$dir\\Bin\\\"",
            "}",
            "Expand-7zipArchive \"$dir\\temp\\TXSSO\\TXSSOSetup.exe\" \"$dir\\Bin\\TXSSO\" -ExtractDir 'TXSSO'",
            "Remove-Item \"$dir\\.rsrc\", \"$dir\\temp\" -Recurse"
        ]
    },
    "checkver": {
        "script": [
            "# Please keep this script. Using 'cdn-go.cn' may result in receiving expired cache responses.",
            "$url = 'https://cdn-go.cn/qq-web/im.qq.com_new/latest/rainbow/windowsConfig.js'",
            "$hostname = ([Uri]$url).Host",
            "$records = Resolve-DnsName 'cdn-go.cn.cloud.tc.qq.com' -Type A -DnsOnly -ErrorAction Ignore",
            "$ip = $records | Where-Object { $_.QueryType -eq 'A' -and $_.IPAddress } | Select-Object -ExpandProperty IP4Address -First 1",
            "$url = $url -Replace [regex]::Escape($hostname), $ip",
            "Invoke-WebRequest -Uri $url -UseBasicParsing -Headers @{'Host' = $hostname} | Select-Object -ExpandProperty Content"
        ],
        "regex": "QQ(?<version>[\\d.]+)\\.exe"
    },
    "autoupdate": {
        "url": "https://dldir1.qq.com/qqfile/qq/PCQQ$matchHead/QQ$version.exe#/dl.7z"
    }
}
