mirror of
https://github.com/sinbad/UEScripts.git
synced 2025-02-23 05:05:24 +00:00
Add option to rename EXE after packaging
This commit is contained in:
parent
0ecdbec381
commit
6b6a72f5b2
@ -102,6 +102,16 @@ The destination of the package operation is generated from a combination of:
|
||||
Therefore if you're building variant "PublicSteamWin64" at version 1.1.2.0, the
|
||||
package output will be in `$OutputDir/1.1.2.0/PublicSteamWin64/`
|
||||
|
||||
### Optionally Rename EXE
|
||||
|
||||
Sometimes you want your packaged EXE to be called something other than your main
|
||||
target game module; unfortunately UE doesn't allow you to change it in the project
|
||||
settings (without renaming your module, which is very inconvenient); but simply
|
||||
renaming it after building works fine, and means you can present a more pleasing
|
||||
EXE name in your build.
|
||||
|
||||
Set `RenameExe` to the name you want your EXE to have, without the `.exe` extension.
|
||||
|
||||
### 9. Optionally Zip Packaged Build
|
||||
|
||||
If you've enabled the `Zip` option for a given variant in [packageconfig.json](PackageConfig.md),
|
||||
|
@ -54,6 +54,8 @@ class PackageConfig {
|
||||
# Will be structured $OutputDir/$version/$variant
|
||||
# If relative, will be considered relative to source folder
|
||||
[string]$OutputDir
|
||||
# Optional name to rename the output EXE to
|
||||
[string]$RenameExe
|
||||
# Folder to place zipped releases (named $target_$platform_$variant_$version.zip)
|
||||
# If relative, will be considered relative to source folder
|
||||
[string]$ZipDir
|
||||
|
@ -5,6 +5,7 @@
|
||||
"ProjectFile": "OptionalProjectFilenameWillDetectInDirOtherwise.uproject",
|
||||
|
||||
"Target": "GameTargetName",
|
||||
"RenameExe": "NewExeNameWithNoExtension",
|
||||
"CookAllMaps": true,
|
||||
"MapsIncluded": [
|
||||
"IfCookAllMapsIsFalse",
|
||||
|
@ -272,6 +272,25 @@ try {
|
||||
|
||||
}
|
||||
|
||||
if ($config.RenameExe.Length -gt 0) {
|
||||
if ($dryrun) {
|
||||
Write-Output "Would have renamed EXE from $($config.Target) to $($config.RenameExe)"
|
||||
} else {
|
||||
# Rename the executable
|
||||
$subdirs = @(Get-ChildItem $outdir)
|
||||
$subdirs | ForEach-Object {
|
||||
$renameExeSuffix = ""
|
||||
if ($var.Platform -like "Win*") {
|
||||
$renameExeSuffix = ".exe"
|
||||
}
|
||||
$exeSrcName = Join-Path $_.FullName "$($config.Target)$renameExeSuffix"
|
||||
$exeDestName = Join-Path $_.FullName "$($config.RenameExe)$renameExeSuffix"
|
||||
Move-Item $exeSrcName $exeDestName -Force
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($var.Zip) {
|
||||
if ($dryrun) {
|
||||
Write-Output "Would have compressed $outdir to $(Join-Path $config.ZipDir "$($config.Target)_$($versionNumber)_$($var.Name).zip")"
|
||||
|
Loading…
x
Reference in New Issue
Block a user