Skip to content

Commit

Permalink
added functionality to install the VSCode context menus. (#1238)
Browse files Browse the repository at this point in the history
* Add functionality to install the VSCode context menus.
* VSCode is now always added to the search path
  • Loading branch information
detlefs authored and Robert Holt committed Jul 11, 2018
1 parent 17c27d3 commit 7cbcb30
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/Install-VSCode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
21/03/2018 - added functionality to install the VSCode context menus. Also, VSCode is now always added to the search path
--
20/03/2018 - fix OS detection to prevent error
--
28/12/2017 - added functionality to support 64-bit versions of VSCode
Expand Down Expand Up @@ -69,6 +71,9 @@
When present, causes Visual Studio Code to be launched as soon as installation
has finished.
.PARAMETER EnableContextMenus
When present, causes the installer to configure the Explorer context menus
.EXAMPLE
Install-VSCode.ps1 -Architecture 32-bit
Expand Down Expand Up @@ -128,7 +133,9 @@ param(
[ValidateNotNull()]
[string[]]$AdditionalExtensions = @(),

[switch]$LaunchWhenDone
[switch]$LaunchWhenDone,

[switch]$EnableContextMenus
)

if (($PSVersionTable.PSVersion.Major -le 5) -or $IsWindows) {
Expand Down Expand Up @@ -178,7 +185,12 @@ if (($PSVersionTable.PSVersion.Major -le 5) -or $IsWindows) {
Invoke-WebRequest -Uri "https://vscode-update.azurewebsites.net/latest/$($bitVersion)/$($BuildEdition)" -OutFile "$env:TEMP\vscode-$($BuildEdition).exe"

Write-Host "`nInstalling $appName..." -ForegroundColor Yellow
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList /silent, /mergetasks=!runcode
if ($EnableContextMenus) {
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList "/verysilent /tasks=addcontextmenufiles,addcontextmenufolders,addtopath"
}
else {
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList "/verysilent /tasks=addtopath"
}
}
else {
Write-Host "`n$appName is already installed." -ForegroundColor Yellow
Expand Down

0 comments on commit 7cbcb30

Please sign in to comment.