Update installer.bat

+changed node.js powershell install. Do not depend on version number always grab the latest
This commit is contained in:
deffcolony
2024-09-08 18:29:14 +02:00
parent 6876cb5c2d
commit 4268635d9d

View File

@@ -181,7 +181,7 @@ if %errorlevel% neq 0 (
echo %yellow_bg%[%time%]%reset% %yellow_fg_strong%[WARN] winget failed to install Node.js or is not installed.%reset%
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Downloading Node.js using PowerShell...
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://nodejs.org/dist/latest/node-v22.8.0-x64.msi', '%bin_dir%\nodejs.msi')"
powershell -Command "$webClient = New-Object System.Net.WebClient; $latestPage = $webClient.DownloadString('https://nodejs.org/dist/latest/'); $msiFile = ($latestPage -split '`n' | Select-String -Pattern 'node-v.+?-x64\.msi' -AllMatches | ForEach-Object { $_.Matches } | Select-Object -First 1).Value; $webClient.DownloadFile(('https://nodejs.org/dist/latest/' + $msiFile), '%bin_dir%\nodejs.msi')"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing Node.js...
start /wait msiexec /i "%bin_dir%\nodejs.msi" /passive