From 09a92a4f5b8da4d6b7bbf60f08416aeb4dbf5490 Mon Sep 17 00:00:00 2001 From: Selene29 Date: Fri, 17 Jan 2025 13:00:48 +0100 Subject: [PATCH] PR: add script to update scripts to VS2022 --- .../UpdateScriptsToVisualStudio2022.bat | 3 +++ .../UpdateScriptsToVisualStudio2022.ps1 | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ExternalLibraries/UpdateScriptsToVisualStudio2022.bat create mode 100644 ExternalLibraries/UpdateScriptsToVisualStudio2022.ps1 diff --git a/ExternalLibraries/UpdateScriptsToVisualStudio2022.bat b/ExternalLibraries/UpdateScriptsToVisualStudio2022.bat new file mode 100644 index 0000000..4220dab --- /dev/null +++ b/ExternalLibraries/UpdateScriptsToVisualStudio2022.bat @@ -0,0 +1,3 @@ +REM filepath: UpdateScriptsToVisualStudio2022.bat +powershell -executionpolicy bypass -File .\UpdateScriptsToVisualStudio2022.ps1 +pause \ No newline at end of file diff --git a/ExternalLibraries/UpdateScriptsToVisualStudio2022.ps1 b/ExternalLibraries/UpdateScriptsToVisualStudio2022.ps1 new file mode 100644 index 0000000..548eeaf --- /dev/null +++ b/ExternalLibraries/UpdateScriptsToVisualStudio2022.ps1 @@ -0,0 +1,21 @@ +# Updates Visual Studio version in all compilation scripts + +$filestoUpdate = @( + "CompileZLib.ps1", + "CompileSundials.ps1", + "CompileHDF5.ps1", + "CompileGraphviz.ps1" +) + +foreach ($file in $filestoUpdate) { + if (Test-Path $file) { + Write-Host "Updating $file..." + $content = Get-Content $file + $content = $content -replace "Visual Studio 16 2019", "Visual Studio 17 2022" + $content | Set-Content $file -Force + } else { + Write-Host "Warning: $file not found" + } +} + +Write-Host "Update completed" \ No newline at end of file