{
    "version": "1.86.0",
    "description": "Lightweight but powerful source code editor",
    "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://update.code.visualstudio.com/1.86.0/win32-x64-archive/stable#/dl.7z",
            "hash": "b2c9eb9b0e954c61e94538142ec91aa19027d4b25fc00ca4b34514fd54cf8571"
        },
        "arm64": {
            "url": "https://update.code.visualstudio.com/1.86.0/win32-arm64-archive/stable#/dl.7z",
            "hash": "0445ad88c8f999e26fc763f2989649e1c081b910918f317a46256d8ccb1cb913"
        }
    },
    "env_add_path": "bin",
    "shortcuts": [
        [
            "code.exe",
            "Visual Studio Code"
        ]
    ],
    "post_install": [
        "$dirpath = \"$dir\".Replace('\\', '\\\\')",
        "$exepath = \"$dir\\Code.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)",
        "    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\\extensions\")) {",
        "    info '[Portable Mode] Copying extensions...'",
        "    Copy-Item \"$env:USERPROFILE\\.vscode\\extensions\" \"$dir\\data\" -Recurse",
        "}",
        "if (!(Test-Path \"$dir\\data\\user-data\") -and (Test-Path \"$env:AppData\\Code\")) {",
        "    info '[Portable Mode] Copying user data...'",
        "    Copy-Item \"$env:AppData\\Code\" \"$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(/|\\\\\\\\)).*?(?=(/|\\\\\\\\)data(/|\\\\\\\\)extensions)', $version | Set-Content \"$extensions_file\"",
        "}"
    ],
    "uninstaller": {
        "script": "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-context.reg\" }"
    },
    "persist": "data",
    "checkver": {
        "url": "https://code.visualstudio.com/sha?build=stable",
        "jsonpath": "$.products[?(@.platform.os == 'win32-x64-archive')].name"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://update.code.visualstudio.com/$version/win32-x64-archive/stable#/dl.7z",
                "hash": {
                    "url": "https://code.visualstudio.com/sha?build=stable",
                    "jsonpath": "$.products[?(@.platform.os == 'win32-x64-archive')].sha256hash"
                }
            },
            "arm64": {
                "url": "https://update.code.visualstudio.com/$version/win32-arm64-archive/stable#/dl.7z",
                "hash": {
                    "url": "https://code.visualstudio.com/sha?build=stable",
                    "jsonpath": "$.products[?(@.platform.os == 'win32-arm64-archive')].sha256hash"
                }
            }
        }
    }
}
