diff --git a/scripts/ps/build.ps1 b/scripts/ps/build.ps1 index ab2f2b89e8..975d33e6bc 100644 --- a/scripts/ps/build.ps1 +++ b/scripts/ps/build.ps1 @@ -28,24 +28,26 @@ $openrct2Path = Join-Path $binPath "openrct2.exe" function Build-Data() { - if(Test-Path "$binPath\data") - { - $object = Get-Item "$binPath\data" - - if(-not ([bool]($object.Attributes -band [IO.FileAttributes]::ReparsePoint))) - { - Write-Host "Copying data to bin..." -ForegroundColor Cyan - New-Item -Force -ItemType Directory $binPath > $null - Copy-Item -Force -Recurse "$rootPath\data" $binPath - } - else{ - Write-Host "Symlink already in place" -ForegroundColor Cyan - } - } - else { - Write-Host "Symlink data to bin..." -ForegroundColor Cyan - New-Item -force -ItemType SymbolicLink -Name bin\data -Target data - } + if(Test-Path "$binPath\data") + { + $object = Get-Item "$binPath\data" + + if(-not ([bool]($object.Attributes -band [IO.FileAttributes]::ReparsePoint))) + { + Write-Host "Copying data to bin..." -ForegroundColor Cyan + New-Item -Force -ItemType Directory $binPath > $null + Copy-Item -Force -Recurse "$rootPath\data" $binPath + } + else + { + Write-Host "Symlink already in place" -ForegroundColor Cyan + } + } + else + { + Write-Host "Symlink data to bin..." -ForegroundColor Cyan + New-Item -force -ItemType SymbolicLink -Name bin\data -Target data + } return 0 } diff --git a/scripts/ps/install.ps1 b/scripts/ps/install.ps1 index d2249d8473..f62c9ef9df 100644 --- a/scripts/ps/install.ps1 +++ b/scripts/ps/install.ps1 @@ -19,7 +19,7 @@ $libsVersion = 7 # Get paths $rootPath = Get-RootPath $libsPath = Join-Path $rootPath "lib" -$binPath = Join-Path $rootPath "bin" +$binPath = Join-Path $rootPath "bin" $zipPath = Join-Path $libsPath "openrct2-libs-vs2015.zip" $libsVersionPath = Join-Path $libsPath "libversion" @@ -36,19 +36,23 @@ if ($currentLibsVersion -ge $libsVersion) } #symlink data to bin\data -try { +try +{ Write-Host "Symlink data to bin..." -ForegroundColor Cyan New-Item -force -ItemType SymbolicLink -Name bin\data -Target data } -catch [System.Management.Automation.ParameterBindingException] { - Write-Host "Your powershell can not create symlinks" -ForegroundColor Red - Write-Host "Copying data to bin..." -ForegroundColor Cyan - New-Item -Force -ItemType Directory $binPath > $null - Copy-Item -Force -Recurse "$rootPath\data" $binPath -} -catch { +catch [System.Management.Automation.ParameterBindingException] +{ + Write-Host "Your powershell can not create symlinks" -ForegroundColor Red + Write-Host "Copying data to bin..." -ForegroundColor Cyan + New-Item -Force -ItemType Directory $binPath > $null + Copy-Item -Force -Recurse "$rootPath\data" $binPath +} +catch +{ Write-Host "Symlink not possible" -ForegroundColor Red - if($force) { + if($force) + { Write-Host "Copying data to bin..." -ForegroundColor Cyan New-Item -Force -ItemType Directory $binPath > $null Copy-Item -Force -Recurse "$rootPath\data" $binPath