From aea3e978b0017d7c59871e5284259bdcff3ff681 Mon Sep 17 00:00:00 2001 From: B Harrell Date: Fri, 18 Jun 2021 21:17:24 -0500 Subject: [PATCH] add check for windows path --- Launch-Scripts/system-check.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Launch-Scripts/system-check.js b/Launch-Scripts/system-check.js index 9870c63f4..27ca73332 100644 --- a/Launch-Scripts/system-check.js +++ b/Launch-Scripts/system-check.js @@ -1,5 +1,7 @@ const { execSync } = require("child_process"); +const os = require("os"); +// Minimum versions required const npmNeededVersion = '5' const nodeNeededVersion = '12' const gitNeededVersion = '2' @@ -15,7 +17,7 @@ function systemCheck () { const nodeVersion = nodeVersionRaw.trim().substring(1).split('.') const gitVersion = gitVersionRaw.trim().split(' ')[2].split('.') - // Check needed versions against those that are installed + // Make sure update version of npm is installed if ( npmVersion[0] < npmNeededVersion ) { console.log(''); console.log("ERROR: the version of npm you have installed is out of date. Please update your installation of npm and try again."); @@ -23,6 +25,7 @@ function systemCheck () { process.exit(); } + // Make sure update version of node is installed if ( nodeVersion[0] < nodeNeededVersion ) { console.log(''); console.log("ERROR: the version of node you have installed is out of date. Please update your installation of node and try again."); @@ -30,12 +33,28 @@ function systemCheck () { process.exit(); } + // Make sure updated version of git is installed if ( gitVersion[0] < gitNeededVersion ) { console.log(''); console.log("ERROR: the version of git you have installed is out of date. Please update your installation of git and try again."); console.log(''); process.exit(); } + + // Check windows system + if (os.platform() == "win32") { + + // Verify C:\Windows\System32 is on the windows PATH + const path = execSync( "echo %PATH%",{ encoding: 'utf8',timeout: 30000 }) + let check = path.includes('System32') + if ( check === false ) { + console.log(''); + console.log("ERROR: it appears C:\\Windows\\System32 is missing from your PATH. Please add to your path and try again."); + console.log(''); + process.exit(); + } + + } } catch (error) { console.log('');