Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to install the User variant of Stable Edition #2160

Merged
merged 7 commits into from
Sep 5, 2019
Merged
22 changes: 19 additions & 3 deletions scripts/Install-VSCode.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#PSScriptInfo

.VERSION 1.3
.VERSION 1.3.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're adding a feature, this would be 1.4.0. Can you update that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 96addda


.GUID 539e5585-7a02-4dd6-b9a6-5dd288d0a5d0

Expand All @@ -25,6 +25,8 @@
.EXTERNALSCRIPTDEPENDENCIES

.RELEASENOTES
30/08/2019 - added functionality to install the "User Install" variant of Stable Edition.
--
07/11/2018 - added support for PowerShell Core and macOS/Linux platforms.
--
15/08/2018 - added functionality to install the new "User Install" variant of Insiders Edition.
Expand Down Expand Up @@ -132,7 +134,7 @@ param(
[string]$Architecture = "64-bit",

[parameter()]
[ValidateSet("Stable", "Insider-System", "Insider-User")]
[ValidateSet("Stable","Stable-User", "Insider-System", "Insider-User")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't do it, but it bothers me that these are double quotes yet the same ValidateSet on line 204 is single quotes...

And a nit: space between comma and "Stable-User"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the script uses single quotes. I could change the double quotes when suitable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 2db94cf

Lothindir marked this conversation as resolved.
Show resolved Hide resolved
[string]$BuildEdition = "Stable",

[Parameter()]
Expand Down Expand Up @@ -199,7 +201,7 @@ function Get-CodePlatformInformation {
$Bitness,

[Parameter(Mandatory=$true)]
[ValidateSet('Stable', 'Insider-System', 'Insider-User')]
[ValidateSet('Stable', 'Stable-User', 'Insider-System', 'Insider-User')]
[string]
$BuildEdition
)
Expand Down Expand Up @@ -231,6 +233,11 @@ function Get-CodePlatformInformation {
break
}

'Stable-User' {
$appName = "Visual Studio Code ($($Architecture) - User)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you used $Architecture here instead of $Bitness like System?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I did the same as the Insiders Edition - user install.

break
}

'Insider-System' {
$appName = "Visual Studio Code - Insiders Edition ($Bitness)"
break
Expand Down Expand Up @@ -321,6 +328,9 @@ function Get-CodePlatformInformation {
'Stable' {
$exePath = "$installBase\Microsoft VS Code\bin\code.cmd"
}
'Stable-User' {
Lothindir marked this conversation as resolved.
Show resolved Hide resolved
$exePath = "${env:LocalAppData}\Programs\Microsoft VS Code\bin\code.cmd"
}

'Insider-System' {
$exePath = "$installBase\Microsoft VS Code Insiders\bin\code-insiders.cmd"
Expand All @@ -339,6 +349,12 @@ function Get-CodePlatformInformation {
break
}

'Stable-User' {
$channel = 'stable'
$platform += '-user'
break
}

'Insider-System' {
$channel = 'insider'
break
Expand Down