mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
add local libversion checks for VS (via powershell)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,6 +13,7 @@ distribution/windows/*.exe
|
||||
|
||||
#lib
|
||||
lib
|
||||
libversion
|
||||
|
||||
#################
|
||||
## Eclipse
|
||||
|
||||
@@ -1,11 +1,33 @@
|
||||
#init
|
||||
$libversion = 1
|
||||
$path = Split-Path $Script:MyInvocation.MyCommand.Path
|
||||
$zip = $path+'\orctlibs.zip'
|
||||
$libs = $path+'\lib'
|
||||
$libsVFile = $path+'\libversion'
|
||||
$libsTest = Test-Path $libs
|
||||
if (!$libsTest) {
|
||||
mkdir $libs
|
||||
|
||||
#libs version test
|
||||
$libsVersionTest = Test-Path $libsVFile
|
||||
$currentVersion = 0
|
||||
$needsdownload = $true
|
||||
if ($libsVersionTest) {
|
||||
$currentVersion = [IO.File]::ReadAllText($libsVFile)
|
||||
}
|
||||
if ($currentVersion -ge $libversion) {
|
||||
$needsdownload = $false
|
||||
}
|
||||
|
||||
#download
|
||||
if (!$libsTest -or $needsdownload) {
|
||||
if ($libsTest) {
|
||||
rm $libs -Recurse -Force
|
||||
}
|
||||
mkdir $libs
|
||||
Invoke-WebRequest https://download.openrct2.website/dev/lib/vs -OutFile $path\orctlibs.zip
|
||||
[System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $libs)
|
||||
rm $path\orctlibs.zip -Force -ErrorAction SilentlyContinue
|
||||
$libversion | Set-Content $libsVFile
|
||||
} else {
|
||||
echo 'All libs up to date'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user