-
Notifications
You must be signed in to change notification settings - Fork 511
added 64bit support & vscode-insiders install support #1137
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
Conversation
scripts/Install-VSCode.ps1
Outdated
@@ -92,27 +105,38 @@ | |||
#> | |||
[CmdletBinding()] | |||
param( | |||
[parameter()] | |||
[ValidateSet("stable","insider")] | |||
[string]$BuildEdition = "stable", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please separate each parameter with a blank line - ditto between lines 113 and 114 - for consistency (see Start-EditorServices.ps1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes made as per comment
@@ -100,19 +117,28 @@ param( | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you added an Architecture
parameter that defaults to 64bit
but also allows a 32bit
value. Then you could test the specific install path (either under Program Files or Program Files (x86) and download the specified bit-version to install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - easy inclusion. I'll add it now.
Another option would be to simply install based on a OSArchitecture check - but if the goal is to allow custom installs, then I suppose it's better to give the end user the option to chose arch?
Architecture params added with failsafe for someone choosing 64bit on a 32bit system. |
scripts/Install-VSCode.ps1
Outdated
@@ -92,6 +114,14 @@ | |||
#> | |||
[CmdletBinding()] | |||
param( | |||
[parameter()] | |||
[ValidateSet(,"64","32")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use 64bit
and 32bit
, then you can use
scripts/Install-VSCode.ps1
Outdated
|
||
switch ($Architecture) { | ||
"64" { | ||
if ((Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture -eq "64-bit") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to use Get-CimInstance here. No GWMI in PS Core - even on Windows.
architecture params are now set to "32-bit" & "64-bit". GWMI replaced with GCIM as per request. Write-Hosts changed to display app name and architecture build. |
scripts/Install-VSCode.ps1
Outdated
|
||
switch ($Architecture) { | ||
"64-bit" { | ||
if ((Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture -eq "64-bit") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot the change to use Get-CimInstance
. :-) Other than that, I think this is ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shit! good catch. I put it in my clipboard and forgot to paste it 💀
scripts/Install-VSCode.ps1
Outdated
break; | ||
} | ||
"32-bit" { | ||
$codePath = ${env:ProgramFiles(x86)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, missed this ... sorry. I'm pretty sure on a 32-bit OS you'd use just ${env:ProgramFiles}. ${env:ProgramFiles(x86)} is unique to the 64-bit version of Windows. See https://en.wikipedia.org/wiki/Environment_variable#Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes. of course. I'll add in the idiot proofing for 32-bit on 64-bit now.
alright so now if you choose 64bit you will get 64bit or 32 bit based on OSArch. If you select 32bit you will get 32bit regardless of OSArch but the $codePath variable changes to reflect the OSArch requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for this @tabs-not-spaces! |
Added a new parameter to be able to install stable / insiders edition based on value of "BuildEdition" parameter. added non-literal paths for install media to support 64-bit installation.
Needs more work to support 32-bit / 64-bit installation.