#author("2021-07-23T09:59:30+09:00","default:ryuichi","ryuichi")
* Portable ModeのVSCodeをアップデート [#pcc3d429]
** 問題 [#c3cc1e65]
- Portable Mode版のVSCodeはインストーラー版と違って自動アップデートが使えない
- したがって、簡易なアップデートが可能なように以下の手順、スクリプトがGitHubコミュニティで提案されている
** スクリプト - Windows [#tb8699b1]
# Remove temp file from portable user data
Remove-Item -Recurse -Force -Path "data/user-data" -Include @("Backups", "Cache", "CachedData", "GPUCache", "logs")
# Download latest stable build
curl.exe -L "https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-archive" -o stable.zip
# Delete anything except user data, update script and downloaded zip file
Get-ChildItem -Exclude @("data", "update.ps1", "stable.zip") | Remove-Item -Recurse -Force
# Unzip it
Expand-Archive -Path "stable.zip" -DestinationPath .
# Delete downloaded package
Remove-Item -Path "stable.zip"
Pause
- 上のスクリプトをVSCodeの実行ファイル(code.exe)がある場所にupdate.ps1というファイル名で保存する
- VSCodeをアップデートしたい時はこのスクリプトを実行する
** 参考 [#u9e38d17]
https://github.com/microsoft/vscode/issues/56326