#author("2021-07-23T10:17:53+09:00","default:ryuichi","ryuichi")
#author("2021-07-23T10:18:15+09:00","default:ryuichi","ryuichi")
* Portable ModeのVSCodeをアップデート [#pcc3d429]

** 問題 [#c3cc1e65]
- Portable Mode版のVSCodeはインストーラー版と違って自動アップデートが使えない
- したがって、簡易なアップデートが可能なように以下の手順、スクリプトがGitHubコミュニティで提案されている

** スクリプト - Windows [#tb8699b1]

*** update.ps1 ファイル [#kd5ab178]

 # 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



*** update.ps1の実行 [#t0ca3be8]

 > .\update.ps1

- 上のスクリプトをVSCodeの実行ファイル(code.exe)がある場所にupdate.ps1というファイル名で保存する
- VSCodeをアップデートしたい時はこのスクリプトを実行する
- なお、このスクリプトはdataフォルダ以下のユーザー設定や拡張機能ファイルを除く、すべてのファイルを削除する。なので、心配なら事前にVSCodeの入ったフォルダーごとバックアップしておくといい

** 参考 [#u9e38d17]

https://github.com/microsoft/vscode/issues/56326

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS