From 9cd110d10498d797aa5f7b061a8f37c929694a59 Mon Sep 17 00:00:00 2001 From: detlefs Date: Wed, 21 Mar 2018 15:14:42 +0100 Subject: [PATCH 1/3] added functionality to install the VSCode context menus. Also, VSCode is now always added to the search path --- scripts/Install-VSCode.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index 9e392b052d..611b904182 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -1,6 +1,6 @@ <#PSScriptInfo -.VERSION 1.1 +.VERSION 1.2 .GUID 539e5585-7a02-4dd6-b9a6-5dd288d0a5d0 @@ -25,6 +25,7 @@ .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES + 21/03/2018 - added functionality to install the VSCode context menus. Also, VSCode is now always added to the search path 28/12/2017 - added functionality to support 64-bit versions of VSCode & support for installation of VSCode Insiders Edition. -- @@ -67,6 +68,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 @@ -126,7 +130,9 @@ param( [ValidateNotNull()] [string[]]$AdditionalExtensions = @(), - [switch]$LaunchWhenDone + [switch]$LaunchWhenDone, + + [switch]$EnableContextMenus ) if (!($IsLinux -or $IsOSX)) { @@ -176,7 +182,12 @@ if (!($IsLinux -or $IsOSX)) { 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 @@ -202,4 +213,4 @@ if (!($IsLinux -or $IsOSX)) { } else { Write-Error "This script is currently only supported on the Windows operating system." -} +} \ No newline at end of file From 820dec8b63d76e92c2e716550ed849d7586cd65c Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 9 Jul 2018 19:38:01 -0700 Subject: [PATCH 2/3] Add newline to script --- scripts/Install-VSCode.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index 611b904182..eb1d2b699d 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -213,4 +213,4 @@ if (!($IsLinux -or $IsOSX)) { } else { Write-Error "This script is currently only supported on the Windows operating system." -} \ No newline at end of file +} From 51074ca7f98f78aa22878cccad93d3cf50301e99 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Mon, 9 Jul 2018 19:40:21 -0700 Subject: [PATCH 3/3] Remove superfluous '--' in release notes --- scripts/Install-VSCode.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/Install-VSCode.ps1 b/scripts/Install-VSCode.ps1 index fd896664ae..a61efcacc5 100644 --- a/scripts/Install-VSCode.ps1 +++ b/scripts/Install-VSCode.ps1 @@ -25,7 +25,6 @@ .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