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)