From dcbbf2ec78b602a8d84c192a109a915d162bb042 Mon Sep 17 00:00:00 2001 From: Marco van Munster Date: Wed, 27 Apr 2016 14:18:51 +0200 Subject: [PATCH] Symlink data to bin\data --- scripts/ps/build.ps1 | 21 ++++++++++++++++++--- scripts/ps/install.ps1 | 4 ++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/scripts/ps/build.ps1 b/scripts/ps/build.ps1 index 99a188f97a..ab2f2b89e8 100644 --- a/scripts/ps/build.ps1 +++ b/scripts/ps/build.ps1 @@ -28,9 +28,24 @@ $openrct2Path = Join-Path $binPath "openrct2.exe" function Build-Data() { - Write-Host "Copying data to bin..." -ForegroundColor Cyan - New-Item -Force -ItemType Directory $binPath > $null - Copy-Item -Force -Recurse "$rootPath\data" $binPath + 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 016e181e65..12c6248022 100644 --- a/scripts/ps/install.ps1 +++ b/scripts/ps/install.ps1 @@ -34,6 +34,10 @@ if ($currentLibsVersion -ge $libsVersion) $updateLibs = $false } +#symlink data to bin\data +Write-Host "Symlink data to bin..." -ForegroundColor Cyan +New-Item -force -ItemType SymbolicLink -Name bin\data -Target data + # Check if user needs to download dependencies $libsPathExists = Test-Path $libsPath if ($libsPathExists -and -not $updateLibs -and -not $Force)