scoop-extras/bucket/vscode.json

96 lines
4.5 KiB
JSON

{
"version": "1.74.2",
"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": "http://dl.simaek.com/scoop/buckets/custom/package/vscode/VSCode-win32-x64-1.74.2.zip#/dl.7z",
"hash": "0afc364b08c1a998902542cd372c2d78ae30d8ab60b472d83245d004af9d4946"
},
"32bit": {
"url": "http://dl.simaek.com/scoop/buckets/custom/package/vscode/VSCode-win32-ia32-1.74.2.zip#/dl.7z",
"hash": "b68b375c5ffe3913377d5c679b09d37eb1a0e7daa5926ba418d8ac65c5035837"
},
"arm64": {
"url": "http://dl.simaek.com/scoop/buckets/custom/package/vscode/VSCode-win32-arm64-1.74.2.zip#/dl.7z",
"hash": "844aa34b40d93f4601fcdf40f7df6693570fc8a5fac0d35d9ca5dea235a2174b"
}
},
"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"
}
},
"32bit": {
"url": "https://update.code.visualstudio.com/$version/win32-archive/stable#/dl.7z",
"hash": {
"url": "https://code.visualstudio.com/sha?build=stable",
"jsonpath": "$.products[?(@.platform.os == 'win32-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"
}
}
}
}
}