Files
cafeberry/Minecraft.Client/Common/Postbuilds/Windows64-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

91 lines
2.6 KiB
PowerShell

param(
[string]$OutDir,
[string]$ProjectDir
)
Write-Host "Windows64 Postbuild script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
$directories = @(
"music",
"Windows64\GameHDD",
"Common\Media",
"Common\res",
"Common\Tutorial",
"Windows64Media",
"redist64"
)
foreach ($dir in $directories) {
New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
}
$copies = @(
@{ Source = "music"; Dest = "music" },
@{ Source = "Common\Media"; Dest = "Common\Media" },
@{ Source = "Common\res"; Dest = "Common\res" },
@{ Source = "Common\Tutorial"; Dest = "Common\Tutorial" },
@{ Source = "Windows64\GameHDD"; Dest = "Windows64\GameHDD" },
@{ Source = "Windows64\Sound"; Dest = "Windows64\Sound" },
@{ Source = "DurangoMedia"; Dest = "Windows64Media" },
@{ Source = "Windows64Media"; Dest = "Windows64Media" },
@{ Source = "Common\Postbuilds\Contents\Windows64\redist64"; Dest = "redist64" }
)
foreach ($copy in $copies) {
$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 = "Common\Postbuilds\Contents\Windows64\Effects.msscmp"; Dest = "Effects.msscmp" },
@{ Source = "Common\Postbuilds\Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" },
@{ Source = "Common\Postbuilds\Contents\Windows64\mss64.dll"; Dest = "mss64.dll" }
)
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
}
}
$deleteDirs = @(
"Common\Media\Sound",
"Common\Media\Graphics",
"Common\Media\de-DE",
"Common\Media\es-ES",
"Common\Media\fr-FR",
"Common\Media\it-IT",
"Common\Media\ja-JP",
"Common\Media\ko-KR",
"Common\Media\pt-BR",
"Common\Media\pt-PT",
"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, MediaOrbis.arc, MediaPS3.arc, MediaPSVita.arc -File |
Remove-Item -Force -ErrorAction SilentlyContinue
}
}
}