99 lines
3.0 KiB
PowerShell
99 lines
3.0 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\Tutorial",
|
|
"Common\res",
|
|
"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 = "PSVita\Tutorial"; Dest = "PS4_GAME\Common\Tutorial" },
|
|
@{ Source = "PS3\Sound"; Dest = "PS4_GAME\Sound" },
|
|
@{ Source = "Common\Postbuilds\Contents\Orbis\sce_module"; Dest = "PS4_GAME\sce_module" },
|
|
@{ Source = "Common\Postbuilds\Contents\Orbis\sce_gls"; Dest = "PS4_GAME\sce_gls" },
|
|
@{ Source = "Common\Postbuilds\Contents\Orbis\sce_sys"; Dest = "PS4_GAME\sce_sys" },
|
|
)
|
|
|
|
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.elf"
|
|
$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
|
|
Copy-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 = @(
|
|
"PS4_GAME\Common\Media",
|
|
"PS4_GAME\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
|
|
}
|
|
}
|
|
} |