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

tools: add Boxstarter script #17046

Closed
wants to merge 4 commits into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+103 −0
Diff settings

Always

Just for now

Next

tools: add Boxstarter script

Adds a Boxstarter script for easy Node.js building prerequisites installation
  • Loading branch information...
bzoz committed Nov 14, 2017
commit 2c7577bc99372e98310d422e4e3f9cc2cf813599
View
@@ -202,6 +202,9 @@ Prerequisites:
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
*Note:* All prerequisites can be easily installed by following
[this Boxstarter guide](https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md).
If the path to your build directory contains a space, the build will likely fail.
```console
View
@@ -0,0 +1,54 @@
# Boxstarter setup for Node.js
A [Boxstarter][] script can be used for an easy setup of Windows systems with all

This comment has been minimized.

@benjamingr

benjamingr Nov 15, 2017

Member

maybe remove an.

the required prerequisites for Node.js development. This script will install
the following [Chocolatey] packages:
* [Git for Windows][] with the `git` and Unix tools added to the `PATH`
* [Python 2.x][]
* [Visual Studio 2017 Build Tools][] with [Visual C++ workload][]
* Optionally: [Visual Studio Code][] e.g. when setting up Code and Learn boxes
## WebLauncher Installation
To install Node.js prerequisites using [Boxstarter WebLauncher][], just open
**one** of the following links with Internet Explorer or Edge browser on the

This comment has been minimized.

@digitalinfinity

digitalinfinity Nov 16, 2017

Contributor

Why does it need to be just those two browsers?

This comment has been minimized.

@bzoz

bzoz Nov 16, 2017

Contributor

It is a "Click Once" app (https://msdn.microsoft.com/en-us/library/t71a733d.aspx). It works in IE and Edge by default, other browsers need a plugin.

target machine:
* [Node.js prerequisites][]
* [Node.js prerequisites with VS Code][]
## PowerShell Installation
To install the Node.js prerequisites using PowerShell, first install Boxstarter:
* From PowerShell v2 (Windows 7, Windows Server 2008):
```console
iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force
```
* From PowerShell v3 (newer Windows systems):
```console
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
```
After Boxstarter has been successfully installed, run:
* For Node.js prerequisites:
```console
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots
```
* For Node.js prerequisites with VS Code:

This comment has been minimized.

@benjamingr

benjamingr Nov 15, 2017

Member

Not sure why we need this?

```console
Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -DisableReboots
```
[Boxstarter]: http://boxstarter.org/
[Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher
[Chocolatey]: https://chocolatey.org/
[Git for Windows]: https://chocolatey.org/packages/git
[Python 2.x]: https://chocolatey.org/packages/python2
[Visual Studio 2017 Build Tools]: https://chocolatey.org/packages/visualstudio2017buildtools
[Visual C++ workload]: https://chocolatey.org/packages/visualstudio2017-workload-vctools
[Visual Studio Code]: https://chocolatey.org/packages/visualstudiocode
[Node.js prerequisites]: http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter
[Node.js prerequisites with VS Code]: http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode
@@ -0,0 +1,21 @@
# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites
#
# To install either open this link in IE or Edge:
# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter
#
# Or run those commands in a Powershell terminal:
# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1'))
# get-boxstarter -Force
# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter -DisableReboots
#
# For more detail see
# https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md
#
# Git and Unix tools will be added to the PATH
choco install git -params /GitAndUnixToolsOnPath -y
choco install python2 -y
# Installs VS 2017 Build Tools
choco install visualstudio2017buildtools -y
choco install visualstudio2017-workload-vctools -y

This comment has been minimized.

@gibfahn

gibfahn Nov 15, 2017

Member

What is the benefit of using Boxstarter here rather than just using chocolatey directly? Is it the web url?

Looking at their page, I'm not seeing anything obviously beneficial, and it's another thing for new starters to understand.

:: Copied from chocolatey website
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

choco install git -params /GitAndUnixToolsOnPath -y
choco install python2 visualstudio2017buildtools visualstudio2017-workload-vctools -y

This comment has been minimized.

@refack

refack Nov 15, 2017

Member

Maybe use a more generic directory name like tools/bootstrap/ and then iterate over recipes.

This comment has been minimized.

@joaocgreis

joaocgreis Nov 16, 2017

Member

This is an improvement either way, but I'd go with boxstarter rather than just chocolatey. For users that want to understand this or already know about chocolatey, the script is very easy to understand and use as a guide for their own custom installation (plus, dependencies are already documented in BUILDING.md).

Looking at the Boxstarter page, it adds a lot of resilience to the process (reboots, disabling updates, etc), moving it much closer to the ideal one-click-no-issues setup.

@@ -0,0 +1,25 @@
# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites,
# including Visual Studio Code
#
# To install either open this link in IE or Edge:
# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode
#
# Or run those commands in a Powershell terminal:
# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1'))
# get-boxstarter -Force
# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/boxstarter/node_boxstarter_vscode -DisableReboots
#
# For more detail see
# https://github.com/nodejs/node/blob/master/tools/boxstarter/README.md
#
# Git and Unix tools will be added to the PATH
choco install git -params /GitAndUnixToolsOnPath -y

This comment has been minimized.

@benjamingr

benjamingr Nov 15, 2017

Member

I'd prefer it if we didn't install the editor as well - most people being onboarded have their own preference for an editor.

choco install python2 -y
# Installs VS 2017 Build Tools
choco install visualstudio2017buildtools -y
choco install visualstudio2017-workload-vctools -y
# Installs Visual Studio Code
choco install visualstudiocode -y

This comment has been minimized.

@gibfahn

gibfahn Nov 15, 2017

Member

+1 to not installing an editor, especially if it means duplicating the whole script.

This comment has been minimized.

@digitalinfinity

digitalinfinity Nov 16, 2017

Contributor

Instead of duplicating the script, we could just check if an environment variable is set indicating whether an editor should be installed? (not advocating one way or the other but just pointing out that we likely don't need to duplicate the whole script)

ProTip! Use n and p to navigate between commits in a pull request.