Skip to content

Commit 9143a4a

Browse files
detlefsrjmholt
authored andcommitted
added functionality to install the VSCode context menus. (#1238)
* Add functionality to install the VSCode context menus. * VSCode is now always added to the search path
1 parent 7a9df00 commit 9143a4a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/Install-VSCode.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
.EXTERNALSCRIPTDEPENDENCIES
2626
2727
.RELEASENOTES
28+
21/03/2018 - added functionality to install the VSCode context menus. Also, VSCode is now always added to the search path
29+
--
2830
20/03/2018 - fix OS detection to prevent error
2931
--
3032
28/12/2017 - added functionality to support 64-bit versions of VSCode
@@ -69,6 +71,9 @@
6971
When present, causes Visual Studio Code to be launched as soon as installation
7072
has finished.
7173
74+
.PARAMETER EnableContextMenus
75+
When present, causes the installer to configure the Explorer context menus
76+
7277
.EXAMPLE
7378
Install-VSCode.ps1 -Architecture 32-bit
7479
@@ -128,7 +133,9 @@ param(
128133
[ValidateNotNull()]
129134
[string[]]$AdditionalExtensions = @(),
130135

131-
[switch]$LaunchWhenDone
136+
[switch]$LaunchWhenDone,
137+
138+
[switch]$EnableContextMenus
132139
)
133140

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

180187
Write-Host "`nInstalling $appName..." -ForegroundColor Yellow
181-
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList /silent, /mergetasks=!runcode
188+
if ($EnableContextMenus) {
189+
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList "/verysilent /tasks=addcontextmenufiles,addcontextmenufolders,addtopath"
190+
}
191+
else {
192+
Start-Process -Wait "$env:TEMP\vscode-$($BuildEdition).exe" -ArgumentList "/verysilent /tasks=addtopath"
193+
}
182194
}
183195
else {
184196
Write-Host "`n$appName is already installed." -ForegroundColor Yellow

0 commit comments

Comments
 (0)