forked from cafeberry/cafeberry
81 lines
2.5 KiB
PowerShell
81 lines
2.5 KiB
PowerShell
param(
|
|
[string]$OutDir,
|
|
[string]$ProjectDir
|
|
)
|
|
|
|
Write-Host "Windows64 Postbuild: script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
|
|
|
|
$directories = @(
|
|
"music",
|
|
"Common\Media",
|
|
"Windows64Media",
|
|
"Windows64\GameHDD",
|
|
"Windows64\redist64"
|
|
)
|
|
|
|
foreach ($dir in $directories) {
|
|
New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
|
|
}
|
|
|
|
$folderCopies = @(
|
|
@{ Source = "music"; Dest = "music" },
|
|
@{ Source = "Common\Media"; Dest = "Common\Media" },
|
|
@{ Source = "Common\res"; Dest = "Common\res" },
|
|
@{ Source = "Windows64Media\DLC"; Dest = "Windows64Media\DLC" },
|
|
@{ Source = "Windows64\Sound"; Dest = "Windows64Media\Sound" },
|
|
#@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru
|
|
@{ Source = "Windows64\Miles\lib\redist64"; Dest = "Windows64\redist64" }
|
|
)
|
|
|
|
foreach ($copy in $folderCopies) {
|
|
$src = Join-Path $ProjectDir $copy.Source
|
|
$dst = Join-Path $OutDir $copy.Dest
|
|
|
|
if (Test-Path $src) {
|
|
xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null
|
|
}
|
|
}
|
|
|
|
$fileCopies = @(
|
|
@{ Source = Join-Path $ProjectDir "Windows64\4JLibs\4J_Input\Windows64\vendor\SDL\lib\x64\SDL3.dll"; Dest = "SDL3.dll" },
|
|
@{ Source = "Common\Media\MediaWindows64.arc"; Dest = "Common\Media\MediaWindows64.arc" },
|
|
@{ Source = Join-Path $PSScriptRoot "Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" },
|
|
@{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" }
|
|
)
|
|
|
|
foreach ($copy in $fileCopies) {
|
|
$src = $copy.Source
|
|
$dst = Join-Path $OutDir $copy.Dest
|
|
if (Test-Path $src) {
|
|
Copy-Item -Path $src -Destination $dst -Force
|
|
} else {
|
|
Write-Host "Windows64 Postbuild: source not found, skipping: $src"
|
|
}
|
|
}
|
|
|
|
$deleteDirs = @(
|
|
"Common\Media\font\RU", #str1k3r - russian font?
|
|
"Common\res\TitleUpdate\DLC",
|
|
"Common\res\TitleUpdate\Audio"
|
|
)
|
|
|
|
foreach ($dir in $deleteDirs) {
|
|
$path = Join-Path $OutDir $dir
|
|
if (Test-Path $path) {
|
|
Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue
|
|
}
|
|
}
|
|
|
|
$delDirs = @(
|
|
"Common\Media\font",
|
|
"Common\Media\font\*",
|
|
"Common\res\TitleUpdate\GameRules"
|
|
)
|
|
|
|
foreach ($dir in $delDirs) {
|
|
$path = Join-Path $OutDir $dir
|
|
if (Test-Path $path) {
|
|
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "DF-DotDotGothic16.ttf", "DFTT_R5.TTC", "candadite2.ttf" -File |
|
|
Remove-Item -Force -ErrorAction SilentlyContinue
|
|
}
|
|
} |