Files
cafeberry/Minecraft.Client/Common/Postbuilds/Orbis-postbuild.ps1
T
54758672ed feat: Postbuild Scripts & Disable Debug Features on Release Builds (#3)
This adds postbuild scripts for PS3, Windows64 & Orbis (Rough Estimation)

This also Excludes the Durango Networking files from being added into other builds along with setting Minecraft.client as the startup project and disabling debug features on release builds.

---------

Co-authored-by: str1k3r <115313679+S1l3ntStr1ke87@users.noreply.github.com>
Reviewed-on: https://git.neolegacy.dev/Project-Elysium/main/pulls/3
Co-authored-by: str1k3r <15+str1k3r@noreply.neolegacy.dev>
Co-committed-by: str1k3r <15+str1k3r@noreply.neolegacy.dev>
2026-07-04 05:58:01 +01:00

97 lines
2.8 KiB
PowerShell

param(
[string]$OutDir,
[string]$ProjectDir
)
Write-Host "Orbis Postbuild script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
$directories = @(
"music",
"Orbis",
"Common",
"Common\Media",
"Common\res",
"Common\Tutorial",
"Sound"
)
foreach ($dir in $directories) {
New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
}
$folderCopies = @(
@{ Source = "music"; Dest = "PS4_GAME\music" },
@{ Source = "Common\Media"; Dest = "PS4_GAME\Common\Media" },
@{ Source = "Common\res"; Dest = "PS4_GAME\Common\res" },
@{ Source = "Common\Tutorial"; Dest = "PS4_GAME\Common\Tutorial" },
@{ Source = "Common\Tutorial"; Dest = "PS4_GAME\Common\Tutorial" },
@{ Source = "PS3\Sound"; Dest = "PS4_GAME\Sound" }
)
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 = "Orbis\PS4ProductCodes.bin"; Dest = "PS4_GAME\Orbis\PS4ProductCodes.bin" },
@{ Source = "Orbis\session_image.jpg"; Dest = "PS4_GAME\Orbis\session_image.jpg" },
)
foreach ($copy in $fileCopies) {
$src = Join-Path $ProjectDir $copy.Source
$dst = Join-Path $OutDir $copy.Dest
if (Test-Path $src) {
Copy-Item -Path $src -Destination $dst -Force
}
}
$builtFile = Join-Path $OutDir "Minecraft.Client.self"
$newName = "eboot.bin"
$destDir = Join-Path $OutDir "PS4_GAME"
$destPath = Join-Path $destDir $newName
if (Test-Path $builtFile) {
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
Move-Item -Path $builtFile -Destination $destPath -Force
}
$deleteDirs = @(
"PS4_GAME\Common\Media\Sound",
"PS4_GAME\Common\Media\Graphics",
"PS4_GAME\Common\Media\de-DE",
"PS4_GAME\Common\Media\es-ES",
"PS4_GAME\Common\Media\fr-FR",
"PS4_GAME\Common\Media\it-IT",
"PS4_GAME\Common\Media\ja-JP",
"PS4_GAME\Common\Media\ko-KR",
"PS4_GAME\Common\Media\pt-BR",
"PS4_GAME\Common\Media\pt-PT",
"PS4_GAME\Common\Media\zh-CHT"
)
foreach ($dir in $deleteDirs) {
$path = Join-Path $OutDir $dir
if (Test-Path $path) {
Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue
}
}
$delDirs = @(
"Common\Media",
"Common\Media\font"
)
foreach ($dir in $delDirs) {
if ($delDirs -contains $dir) {
$path = Join-Path $OutDir $dir
if (Test-Path $path) {
Get-ChildItem -Path $path -Recurse -Include *.swf, *.txt, *.resx, *.xml, *.loc, *.lang, *.col, *.h, *.xui, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", MediaDurango.arc, MediaWindows64.arc, MediaPS3.arc, MediaPSVita.arc -File |
Remove-Item -Force -ErrorAction SilentlyContinue
}
}
}