From 9f195144ce3ccbe67c9421e7419251f5eebd0693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Wed, 29 Aug 2018 23:22:51 +0100 Subject: [PATCH 1/3] win,msi: install tools for native modules Add a dialog during installation with information about native modules that can optionally run a Boxstarter script at the end of the installation. This script can also be run from Start menu. Fixes: https://github.com/nodejs/node/issues/22311 --- tools/msvs/install_tools/install_tools.bat | 25 +++++++++++++ tools/msvs/install_tools/install_tools.txt | 3 ++ tools/msvs/msi/i18n/en-us.wxl | 8 ++++ tools/msvs/msi/product.wxs | 43 +++++++++++++++++++++- 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 tools/msvs/install_tools/install_tools.bat create mode 100644 tools/msvs/install_tools/install_tools.txt diff --git a/tools/msvs/install_tools/install_tools.bat b/tools/msvs/install_tools/install_tools.bat new file mode 100644 index 00000000000000..bc8bc9633e931f --- /dev/null +++ b/tools/msvs/install_tools/install_tools.bat @@ -0,0 +1,25 @@ +@echo off + +echo ==================================================== +echo Tools for Node.js Native Modules Installation Script +echo ==================================================== +echo. +echo This Boxstarter script will install Python and the Visual Studio Build Tools, +echo necessary to compile Node.js native modules. All necessary Windows updates +echo will also be installed. +echo. +echo This will require about 3 Gb of free disk space, plus any space necessary to +echo install Windows updates. +echo. +echo This will take a while to run. Your computer may reboot during the +echo installation, and will resume automatically. +echo. +echo Please close all open programs for the duration of the installation. +echo. +echo You can close this window to stop now. This script can be invoked from the +echo Start menu. Detailed instructions to install these tools manually are +echo available at https://github.com/nodejs/node-gyp#on-windows +echo. +pause + +"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force; Install-BoxstarterPackage -PackageName '%~dp0\install_tools.txt'" diff --git a/tools/msvs/install_tools/install_tools.txt b/tools/msvs/install_tools/install_tools.txt new file mode 100644 index 00000000000000..baf530a774759b --- /dev/null +++ b/tools/msvs/install_tools/install_tools.txt @@ -0,0 +1,3 @@ +choco upgrade -y python2 +choco upgrade -y visualstudio2017buildtools +choco upgrade -y visualstudio2017-workload-vctools diff --git a/tools/msvs/msi/i18n/en-us.wxl b/tools/msvs/msi/i18n/en-us.wxl index 86da6ecc40ecaf..5184fd2e2ec96f 100644 --- a/tools/msvs/msi/i18n/en-us.wxl +++ b/tools/msvs/msi/i18n/en-us.wxl @@ -8,6 +8,14 @@ A later version of [ProductName] is already installed. Setup will now exit. + [ProductName] Setup + {\WixUI_Font_Title}Tools for Native Modules + Optionally install the tools necessary to compile native modules. + WixUI_Bmp_Banner + 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 VS Build Tools) need to be installed. + Automatically install the necessary tools. The script will pop-up in a new window after the installation completes. + Alternatively, follow the instructions at https://github.com/nodejs/node-gyp#on-windows]]> to install the dependencies yourself. + Node.js runtime Install the core [ProductName] runtime (node.exe). diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index e9e4e33751d254..ad48fedafd9ea0 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -72,6 +72,8 @@ + + + + + + + + + + @@ -195,6 +205,12 @@ Arguments='/k "[INSTALLDIR]nodevars.bat"' Show="normal" WorkingDirectory="INSTALLDIR"/> + + + + @@ -340,6 +359,23 @@ + + + + + + + + + + + + + + + 1 + + NOT Installed Installed AND PATCH @@ -350,7 +386,6 @@ 1 1 1 - 1 NOT Installed OR WixUI_InstallMode = "Change" Installed AND NOT PATCH Installed AND PATCH @@ -361,7 +396,11 @@ 1 Installed NOT Installed - 1 + 1 + 1 + 1 + NATIVETOOLSCHECKBOX = 1 + 1 From 2b632a0ba8e63e9ef8d3f55ddd88458b0db1056a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Sun, 2 Sep 2018 01:18:56 +0100 Subject: [PATCH 2/3] fixup: use https --- tools/msvs/install_tools/install_tools.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/msvs/install_tools/install_tools.bat b/tools/msvs/install_tools/install_tools.bat index bc8bc9633e931f..6bef8ca5b64258 100644 --- a/tools/msvs/install_tools/install_tools.bat +++ b/tools/msvs/install_tools/install_tools.bat @@ -22,4 +22,4 @@ echo available at https://github.com/nodejs/node-gyp#on-windows echo. pause -"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force; Install-BoxstarterPackage -PackageName '%~dp0\install_tools.txt'" +"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -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'" From 1d0872a58c0ef28b852ad29c849ca114b7051908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Wed, 5 Sep 2018 17:47:34 +0100 Subject: [PATCH 3/3] fixup: Visual Studio --- tools/msvs/msi/i18n/en-us.wxl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/msvs/msi/i18n/en-us.wxl b/tools/msvs/msi/i18n/en-us.wxl index 5184fd2e2ec96f..71c17014911033 100644 --- a/tools/msvs/msi/i18n/en-us.wxl +++ b/tools/msvs/msi/i18n/en-us.wxl @@ -12,7 +12,7 @@ {\WixUI_Font_Title}Tools for Native Modules Optionally install the tools necessary to compile native modules. WixUI_Bmp_Banner - 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 VS Build Tools) need to be installed. + 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. Automatically install the necessary tools. The script will pop-up in a new window after the installation completes. Alternatively, follow the instructions at https://github.com/nodejs/node-gyp#on-windows]]> to install the dependencies yourself.