aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Slan <duartejhfaria@gmail.com>2022-07-06 03:18:45 +0100
committerLibravatar GitHub <noreply@github.com>2022-07-06 02:18:45 +0000
commite0f50b24905599578ca358f181a6b8e4a8d80fd5 (patch)
tree4a96ea453e413c0b75d8e39d8ebc4ae8e5e6b16a /scripts
parentAdd Server Information to About Dialog and to Global Messages (#425) (diff)
downloadferdium-app-e0f50b24905599578ca358f181a6b8e4a8d80fd5.tar.gz
ferdium-app-e0f50b24905599578ca358f181a6b8e4a8d80fd5.tar.zst
ferdium-app-e0f50b24905599578ca358f181a6b8e4a8d80fd5.zip
Checks if MSVS 2019 or 2022 exists through reg key [skip ci] (#432)
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
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# -----------------------------------------------------------------------------