Skip to content

Commit 4d9a265

Browse files
joaocgreisBridgeAR
authored andcommitted
win: do not use Boxstarter to install tools
Use Chocolatey directly in the tools installation script. PR-URL: #24677 Fixes: #23838 Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 71e520c commit 4d9a265

File tree

4 files changed

+16
-53
lines changed

4 files changed

+16
-53
lines changed
+15-44
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
@echo off
22

33
setlocal
4+
title Install Additional Tools for Node.js
45

56
cls
7+
68
echo ====================================================
79
echo Tools for Node.js Native Modules Installation Script
810
echo ====================================================
911
echo.
10-
echo This Boxstarter script will install Python and the Visual Studio Build Tools,
11-
echo necessary to compile Node.js native modules. Note that Boxstarter,
12-
echo Chocolatey and required Windows updates will also be installed.
12+
echo This script will install Python and the Visual Studio Build Tools, necessary
13+
echo to compile Node.js native modules. Note that Chocolatey and required Windows
14+
echo updates will also be installed.
1315
echo.
1416
echo This will require about 3 Gb of free disk space, plus any space necessary to
15-
echo install Windows updates.
16-
echo.
17-
echo This will take a while to run. Your computer may reboot during the
18-
echo installation, and will resume automatically.
17+
echo install Windows updates. This will take a while to run.
1918
echo.
20-
echo Please close all open programs for the duration of the installation.
19+
echo Please close all open programs for the duration of the installation. If the
20+
echo installation fails, please ensure Windows is fully updated, reboot your
21+
echo computer and try to run this again. This script can be found in the
22+
echo Start menu under Node.js.
2123
echo.
22-
echo You can close this window to stop now. This script can be invoked from the
23-
echo Start menu. Detailed instructions to install these tools manually are
24-
echo available at https://github.com/nodejs/node-gyp#on-windows
24+
echo You can close this window to stop now. Detailed instructions to install these
25+
echo tools manually are available at https://github.com/nodejs/node-gyp#on-windows
2526
echo.
2627
pause
2728

2829
cls
30+
2931
REM Adapted from https://github.com/Microsoft/windows-dev-box-setup-scripts/blob/79bbe5bdc4867088b3e074f9610932f8e4e192c2/README.md#legal
3032
echo Using this script downloads third party software
3133
echo ------------------------------------------------
@@ -36,49 +38,18 @@ echo result of a Chocolatey install. This acceptance occurs whether you know the
3638
echo license terms or not. Read and understand the license terms of the packages
3739
echo being installed and their dependencies prior to installation:
3840
echo - https://chocolatey.org/packages/chocolatey
39-
echo - https://chocolatey.org/packages/boxstarter
4041
echo - https://chocolatey.org/packages/python2
41-
echo - https://chocolatey.org/packages/visualstudio2017buildtools
4242
echo - https://chocolatey.org/packages/visualstudio2017-workload-vctools
4343
echo.
4444
echo This script is provided AS-IS without any warranties of any kind
4545
echo ----------------------------------------------------------------
4646
echo Chocolatey has implemented security safeguards in their process to help
4747
echo protect the community from malicious or pirated software, but any use of this
4848
echo script is at your own risk. Please read the Chocolatey's legal terms of use
49-
echo and the Boxstarter project license as well as how the community repository
50-
echo for Chocolatey.org is maintained.
49+
echo as well as how the community repository for Chocolatey.org is maintained.
5150
echo.
5251
pause
5352

5453
cls
55-
echo !!!!!WARNING!!!!!
56-
echo -----------------
57-
echo This script should make installing the tools as easy as possible. Hence, it
58-
echo WILL NOT OFFER ANY CUSTOMIZATION. If there's any parameter you'd like to
59-
echo customize (like installation directory or features), or if there's any
60-
echo special rule or policy that your computer should comply to (like not being
61-
echo able to log in as the user with administrative privileges), please follow the
62-
echo instructions to download and execute the installers directly:
63-
echo https://github.com/nodejs/node-gyp#on-windows
64-
echo.
65-
echo Use of Boxstarter may reboot your computer automatically multiple times.
66-
echo When performing a reboot, Boxstarter will need to disable User Account
67-
echo Control (UAC) to allow the script to run immediately after the reboot. When
68-
echo the scripts have completed, Boxstarter will re-enable UAC. If you prematurely
69-
echo stop the process, UAC will need to be re-enabled manually.
70-
echo.
71-
echo Sometimes the scripts may install all necessary Windows Updates which
72-
echo could cause a high number of reboots that appear to be a reboot loop when
73-
echo in fact it is just a normal Windows Updates reboot cycle.
74-
:acceptretry
75-
echo.
76-
echo Your computer may REBOOT SEVERAL TIMES WITHOUT FURTHER WARNING.
77-
echo Please type YES followed by enter to confirm that you have saved all your
78-
set /p "ACCEPT_PROMPT=work and closed all open programs: "
79-
if /i not "%ACCEPT_PROMPT%"=="yes" (
80-
echo Please type YES to confirm, or close the window to exit.
81-
goto acceptretry
82-
)
8354

84-
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -ArgumentList '-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command iex ((New-Object System.Net.WebClient).DownloadString(''https://boxstarter.org/bootstrapper.ps1'')); get-boxstarter -Force; Install-BoxstarterPackage -PackageName ''%~dp0\install_tools.txt''; Read-Host ''Type ENTER to exit'' ' -Verb RunAs
55+
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -ArgumentList '-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command iex ((New-Object System.Net.WebClient).DownloadString(''https://chocolatey.org/install.ps1'')); choco upgrade -y python2 visualstudio2017-workload-vctools; Read-Host ''Type ENTER to exit'' ' -Verb RunAs

tools/msvs/install_tools/install_tools.txt

-3
This file was deleted.

tools/msvs/msi/i18n/en-us.wxl

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<String Id="NativeToolsDlgDescription">Optionally install the tools necessary to compile native modules.</String>
1414
<String Id="NativeToolsDlgBannerBitmap">WixUI_Bmp_Banner</String>
1515
<String Id="NativeToolsDlgIntro">Some npm modules need to be compiled from C/C++ when installing. If you want to be able to install such modules, some tools (Python 2 and Visual Studio Build Tools) need to be installed.</String>
16-
<String Id="NativeToolsDlgInstallCheckbox">Automatically install the necessary tools. Note that this will also install Boxstarter and Chocolatey. The script will pop-up in a new window after the installation completes.</String>
16+
<String Id="NativeToolsDlgInstallCheckbox">Automatically install the necessary tools. Note that this will also install Chocolatey. The script will pop-up in a new window after the installation completes.</String>
1717
<String Id="NativeToolsDlgManualDetails">Alternatively, follow the instructions at <![CDATA[<a href="https://github.com/nodejs/node-gyp#on-windows">https://github.com/nodejs/node-gyp#on-windows</a>]]> to install the dependencies yourself.</String>
1818

1919
<!-- References like [ProductName] or $(var.ProductName) don't seem to work in Title attributes -->

tools/msvs/msi/product.wxs

-5
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
<ComponentRef Id="NodeStartMenu"/>
7474
<ComponentRef Id="AppData" />
7575
<ComponentRef Id="InstallToolsBat" />
76-
<ComponentRef Id="InstallToolsTxt" />
7776
<ComponentGroupRef Id="Product.Generated"/>
7877

7978
<Feature Id="NodeEtwSupport"
@@ -161,10 +160,6 @@
161160
<File Id="InstallToolsBat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\install_tools\install_tools.bat"/>
162161
</Component>
163162

164-
<Component Id="InstallToolsTxt">
165-
<File Id="InstallToolsTxt" Source="$(var.RepoDir)\tools\msvs\install_tools\install_tools.txt"/>
166-
</Component>
167-
168163
<?if $(var.NoETW) != 1 ?>
169164
<Component Id="NodeEtwSupport">
170165
<File Id="node_etw_provider.man" Source="$(var.RepoDir)\src\res\node_etw_provider.man">

0 commit comments

Comments
 (0)