aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build-windows.ps125
1 files changed, 18 insertions, 7 deletions
diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1
index 064eb026c..f0aeaee32 100644
--- a/scripts/build-windows.ps1
+++ b/scripts/build-windows.ps1
@@ -40,7 +40,6 @@ Function Test-CommandExists { Param ($command, $1)
40# Check for installed programmes 40# Check for installed programmes
41Test-CommandExists node "Node is not installed" 41Test-CommandExists node "Node is not installed"
42Test-CommandExists npm "npm is not installed" 42Test-CommandExists npm "npm is not installed"
43# TODO: Needs proper way to check MSVS Build Tools
44 43
45# Check node version 44# Check node version
46$EXPECTED_NODE_VERSION = (cat .nvmrc) 45$EXPECTED_NODE_VERSION = (cat .nvmrc)
@@ -94,14 +93,26 @@ if ($env:CLEAN -eq "true")
94 93
95# ----------------------------------------------------------------------------- 94# -----------------------------------------------------------------------------
96# Ensure that the system dependencies are at the correct version - fail if not 95# Ensure that the system dependencies are at the correct version - fail if not
97# TODO: Needs proper way to check MSVS Tools
98# Check MSVS Tools through MSVS_VERSION 96# Check MSVS Tools through MSVS_VERSION
99$EXPECTED_MSVST_VERSION = @("2019", "2022") 97$EXPECTED_MSVST_VERSION = @("2019","2022")
100$ACTUAL_MSVST_VERSION = (npm config get msvs_version) 98$MSVS_REG_PATH = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup"
101if (-not ($EXPECTED_MSVST_VERSION -contains $ACTUAL_MSVST_VERSION)) { 99
100if(-not (Test-Path -Path $MSVS_REG_PATH)){
101 fail_with_docs "You don't have MSVS Tools Installed!"
102}
103
104$MSVS_PATH = (Get-ItemProperty -Path $MSVS_REG_PATH).SharedInstallationPath | Split-Path
105
106Get-ChildItem($MSVS_PATH) | ForEach-Object{
107 if($EXPECTED_MSVST_VERSION -contains $_){
108 $ACTUAL_MSVST_VERSION = $_
109 break
110 }
111}
112
113if(-not $ACTUAL_MSVST_VERSION){
102 fail_with_docs "You are not running the expected version of MSVS Tools! 114 fail_with_docs "You are not running the expected version of MSVS Tools!
103 expected: [$EXPECTED_MSVST_VERSION] 115 expected: [$EXPECTED_MSVST_VERSION]"
104 actual : [$ACTUAL_MSVST_VERSION]"
105} 116}
106 117
107# ----------------------------------------------------------------------------- 118# -----------------------------------------------------------------------------