{
    "version": "14.50.35719.0",
    "description": "Microsoft Visual C++ Redistributable for Visual Studio 2015-2022",
    "homepage": "https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist",
    "license": {
        "identifier": "Freeware",
        "url": "https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx"
    },
    "notes": "You can now remove this installer with 'scoop uninstall vcredist2022'",
    "url": [
        "https://aka.ms/vc14/vc_redist.x64.exe",
        "https://aka.ms/vc14/vc_redist.x86.exe"
    ],
    "hash": [
        "8995548dfffcde7c49987029c764355612ba6850ee09a7b6f0fddc85bdc5c280",
        "e7267c1bdf9237c0b4a28cf027c382b97aa909934f84f1c92d3fb9f04173b33e"
    ],
    "post_install": [
        "# For error codes, see https://docs.microsoft.com/en-us/windows/win32/msi/error-codes",
        "$ec = @{",
        "    1638 = 'This product is already installed';",
        "    3010 = 'A restart is required to complete the installation';",
        "}",
        "Invoke-ExternalCommand -FilePath \"$dir\\vc_redist.x64.exe\" -ArgumentList '/fo', '/quiet', '/norestart' -ContinueExitCodes $ec -RunAs | Out-Null",
        "Invoke-ExternalCommand -FilePath \"$dir\\vc_redist.x86.exe\" -ArgumentList '/fo', '/quiet', '/norestart' -ContinueExitCodes $ec -RunAs | Out-Null"
    ],
    "checkver": {
        "script": [
            "# download 1 MB and extract version from the file itself",
            "$wc = [System.Net.HttpWebRequest]::Create('https://aka.ms/vc14/vc_redist.x64.exe')",
            "$wc.AddRange(0, 1000000)",
            "$sr = New-Object -TypeName System.IO.StreamReader -ArgumentList $wc.GetResponse().GetResponseStream()",
            "if ($sr.ReadToEnd() -match \"P\\x00r\\x00o\\x00d\\x00u\\x00c\\x00t\\x00V\\x00e\\x00r\\x00s\\x00i\\x00o\\x00n\\x00\\x00\\x00(?<version>.*?)\\x00\\x00\\x00D\") { return $Matches['version'].Replace(\"`0\", '') } else { return '' }"
        ],
        "regex": "(.*)"
    },
    "autoupdate": {
        "url": [
            "https://aka.ms/vc14/vc_redist.x64.exe",
            "https://aka.ms/vc14/vc_redist.x86.exe"
        ]
    }
}
