{
    "version": "1.120.0-20544b7",
    "description": "Visual Studio Code is a lightweight but powerful source code editor (Insiders, Portable Edition).",
    "homepage": "https://code.visualstudio.com/",
    "license": {
        "identifier": "Freeware",
        "url": "https://code.visualstudio.com/License/"
    },
    "notes": [
        "Add Visual Studio Code as a context menu option by running:",
        "reg import \"$dir\\install-context.reg\"",
        "For file associations, run:",
        "reg import \"$dir\\install-associations.reg\""
    ],
    "architecture": {
        "64bit": {
            "url": "https://vscode.download.prss.microsoft.com/dbazure/download/insider/20544b72e9c754dbd1429db2d4c457de6dc1efe2/VSCode-win32-x64-1.120.0-insider.zip",
            "hash": "2cc84882e28969ed396e9eca8653e61fe4ebd58811bee984b98c121277ea7cac"
        },
        "arm64": {
            "url": "https://vscode.download.prss.microsoft.com/dbazure/download/insider/20544b72e9c754dbd1429db2d4c457de6dc1efe2/VSCode-win32-arm64-1.120.0-insider.zip",
            "hash": "359f39d397a5ec73623f0c87ac1747a41473b5af5aa95b1fdedd1889f372ba14"
        }
    },
    "post_install": [
        "$dirpath = \"$dir\".Replace('\\', '\\\\')",
        "$exepath = \"$dir\\Code - Insiders.exe\".Replace('\\', '\\\\')",
        "'install-associations', 'uninstall-associations', 'install-context', 'uninstall-context' | ForEach-Object {",
        "  if (Test-Path \"$bucketsdir\\extras\\scripts\\vscode\\$_.reg\") {",
        "    $content = Get-Content \"$bucketsdir\\extras\\scripts\\vscode\\$_.reg\"",
        "    $content = $content.Replace('$codedir', $dirpath)",
        "    $content = $content.Replace('$code', $exepath)",
        "    $content = $content.Replace('&Code', 'Code &Insiders')",
        "    if ($global) {",
        "      $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')",
        "    }",
        "    $content | Set-Content -Path \"$dir\\$_.reg\"",
        "  }",
        "}",
        "if (!(Test-Path \"$dir\\data\\extensions\") -and (Test-Path \"$env:USERPROFILE\\.vscode-insiders\\extensions\")) {",
        "    info '[Portable Mode] Copying extensions...'",
        "    Copy-Item \"$env:USERPROFILE\\.vscode-insiders\\extensions\" \"$dir\\data\" -Recurse",
        "}",
        "if (!(Test-Path \"$dir\\data\\user-data\") -and (Test-Path \"$env:AppData\\Code - Insiders\")) {",
        "    info '[Portable Mode] Copying user data...'",
        "    Copy-Item \"$env:AppData\\Code - Insiders\" \"$dir\\data\\user-data\" -Recurse",
        "}",
        "$extensions_file = \"$dir\\data\\extensions\\extensions.json\"",
        "if ((Test-Path \"$extensions_file\")) {",
        "    info 'Adjusting path in extensions file...'",
        "    (Get-Content \"$extensions_file\") -replace '(?<=vscode-insiders(/|\\\\\\\\)).*?(?=(/|\\\\\\\\)data(/|\\\\\\\\)extensions)', $version | Set-Content \"$extensions_file\"",
        "}"
    ],
    "env_add_path": "bin",
    "shortcuts": [
        [
            "Code - Insiders.exe",
            "Visual Studio Code - Insiders"
        ]
    ],
    "persist": "data",
    "uninstaller": {
        "script": "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-context.reg\" }"
    },
    "checkver": {
        "url": "https://update.code.visualstudio.com/api/update/win32-x64-archive/insider/latest",
        "jsonpath": "$..['version', 'productVersion']",
        "regex": "^\\[\"(?<commit>(?<commitShort>[0-9a-f]{7})[0-9a-f]*)\",\"(?<productVersion>.+)-insider\"",
        "replace": "${productVersion}-${commitShort}"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://vscode.download.prss.microsoft.com/dbazure/download/insider/$matchCommit/VSCode-win32-x64-$matchHead-insider.zip",
                "hash": {
                    "url": "https://update.code.visualstudio.com/api/update/win32-x64-archive/insider/latest",
                    "jsonpath": "$.sha256hash"
                }
            },
            "arm64": {
                "url": "https://vscode.download.prss.microsoft.com/dbazure/download/insider/$matchCommit/VSCode-win32-arm64-$matchHead-insider.zip",
                "hash": {
                    "url": "https://update.code.visualstudio.com/api/update/win32-arm64-archive/insider/latest",
                    "jsonpath": "$.sha256hash"
                }
            }
        }
    }
}
