diff --git a/getFNA_Win.ps1 b/getFNA_Win.ps1 new file mode 100644 index 0000000..282804b --- /dev/null +++ b/getFNA_Win.ps1 @@ -0,0 +1,34 @@ +# getFNA_Win +# Clones/pulls the latest FNA from Github for use as a project reference. +# Usage: ./getFNA_Win.bat + +git --version > $null +if ( -Not $? ) { + Write-Error "ERROR: Git is required to pull FNA from the command line." + Write-Output "Either install git or download and unzip FNA manually." + exit 1 +} + +# Downloading +if ( -Not (Test-Path -Path "FNA") ) { + Write-Output "Cloning FNA..." + git clone https://github.com/FNA-XNA/FNA.git --recursive + if ($?) { + Write-Output "Finished cloning!" + } + else { + Write-Error "ERROR: Unable to clone successfully. Maybe try again later?" + exit 1 + } +} +else { + Write-Output "Pulling the latest git version of FNA..." + git -C FNA pull --recurse-submodules + if ($?) { + Write-Output "Finished updating!" + } + else { + Write-Error "ERROR: Unable to update." + exit 1 + } +} \ No newline at end of file diff --git a/getLibs.sh b/getLibs.sh index 75d9d21..6b367e8 100755 --- a/getLibs.sh +++ b/getLibs.sh @@ -14,7 +14,7 @@ else exit 1 fi -# Unzipping +# Decompressing echo "Decompressing fnalibs..." mkdir fnalibs tar xjC fnalibs -f fnalibs.tar.bz2 diff --git a/getLibs_Win.ps1 b/getLibs_Win.ps1 new file mode 100644 index 0000000..9781671 --- /dev/null +++ b/getLibs_Win.ps1 @@ -0,0 +1,34 @@ +# getLibs_Win +# Downloads and untars the latest archive of pre-compiled native libraries for FNA. +# Note: This requires 7-Zip to be installed. +# Usage: ./getLibs + +# Downloading +Write-Output "Downloading latest fnalibs..." +Invoke-WebRequest -Uri http://fna.flibitijibibo.com/archive/fnalibs.tar.bz2 -OutFile fnalibs.tar.bz2 +if ($?) { + Write-Output "Finished downloading!" +} +else { + Write-Error "ERROR: Unable to download successfully. Maybe try again later?" + exit 1 +} + +# Is 7Zip installed? +# Edit this to be Program Files (x86) if you installed the 32-bit version. +$7zip = 'C:\Program Files\7-Zip\7z.exe' +& $7zip >$null +if (-Not $?) +{ + Write-Error "7Zip is required to decompress fnalibs." + exit 1 +} + +# Decompress +& $7zip x -y fnalibs.tar.bz2 >$null +& $7zip x -y fnalibs.tar -o* >$null + +Remove-Item fnalibs.tar.bz2 +Remove-Item fnalibs.tar + +Write-Output "fnalibs extracted!" \ No newline at end of file