[UE4] Several packaging methods for Windows

brief description

  • Automation Tool (Unreal Automation Tool, referred to as UAT)
  • Automated tools use the specific command BuildCookRun
    • The packaging process includes
      • Build (Build): This phase will compile the executable for the selected platform.
      • Cook: This stage transforms the content by executing the editor in a special mode.
      • Stage: This stage copies the executable and content to the staging area, which is a separate directory from the development directory.
      • Package: This stage packages the project into the platform's native distribution format.
      • Deploy: This phase deploys the build to target devices.
      • Run (Run): This stage starts the packaged project on the target platform.
  • You can use RunUAT.bat for packaging, the path is Engine/Build/BatchFiles/RunUAT.bat
  • The savegame path after shipping is packaged is C:\Users\[UserName]\AppData\Local\[ProjectName]\Saved\SaveGames

Editor packaging

  • File -> Package Project -> Target Platform
  • compile configuration
    • DebugGame
    • Development
    • Shipping
    • The default path is generated  [ProjectName]\WindowsNoEditor, and the path can be customized
  • More settings ProjectSettings -> Package
  • Log Running AutomationTool section
    Running AutomationTool
    UATHelper: Packaging (Windows (64-bit)): Parsing command line:
     -ScriptsForProject="C:/Users/Alice/Documents/Unreal Projects/tips/tips.uproject"
     BuildCookRun -nocompileeditor -installed -nop4
     -project="C:/Users/Alice/Documents/Unreal Projects/tips/tips.uproject"
     -cook -stage -archive
     -archivedirectory="C:/Users/Alice/Documents/Unreal Projects/tips"
     -package
     -ue4exe=C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe
     -compressed
     -ddc=InstalledDerivedDataBackendGraph
     -pak
     -prereqs
     -nodebuginfo
     -targetplatform=Win64
     -build
     -target=tips
     -clientconfig=Development
     -utf8output
    


Start Launch on the device

  • PIE Toolbar Launch
    • default build path [ProjectName]\Saved\StagedBuilds\WindowsNoEditor
    • Execute by default
      C:\Users\Alice\Documents\Unreal Projects\tips\Saved\StagedBuilds\WindowsNoEditor\tips\Binaries\Win64\tips.exe 
       ../../../tips/tips.uproject /Game/CPPFunction/Pak/PakMap
       -stdout
       -abslog="C:\Users\Alice\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+SoftwareInstallation+EpicGames+UE_4.26\Client.log"
       -Messaging
       -Windowed
       -CrashForUAT
       -SessionId=E68DB8EB44C5712DE6D61BBE209F527E
       -SessionOwner="Alice"
       -SessionName="Launch On Device"
      
  • Can be customized in Project Launcher
  • Can use UnrealFrontend [EnegineDir]\Engine\Binaries\Win64\UnrealFrontend.exe
    • UnrealFrontend can perform advanced build, cook, deploy, package and launch options

Project Launcher Packaging

  • icon
  • Steps
    • Running AutomationTool
    Parsing command line:
    -ScriptsForProject="C:/Users/Alice/Documents/Unreal Projects/tips/tips.uproject"
     BuildCookRun
     -project="C:/Users/Alice/Documents/Unreal Projects/tips/tips.uproject"
     -noP4
     -clientconfig=Development
     -serverconfig=Development
     -nocompile
     -nocompileeditor
     -installed
     -ue4exe=C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe
     -utf8output
     -platform=Win64
     -targetplatform=Win64
     -build
     -cook
     -map=
     -unversionedcookedcontent
     -pak
     -createreleaseversion=1.0.0
     -compressed
     -prereqs
     -stage
     -package
     -cmdline=" -Messaging"
     -addcmdline="-SessionId=9876DEE24FEBCC47A5E8C29B1BDD9E48 -SessionOwner='Alice' -SessionName='tip' "
     -archive
     -archivedirectory="C:/Users/Alice/Documents/Unreal Projects/tips/"
    
    • BUILD COMMAND STARTED
    Running: 
    C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe
     tips Win64 Development
     -Project="C:\Users\Alice\Documents\Unreal Projects\tips\tips.uproject"
     "C:\Users\Alice\Documents\Unreal Projects\tips\tips.uproject"
     -NoUBTMakefiles  -remoteini="C:\Users\Alice\Documents\Unreal Projects\tips"
     -skipdeploy
     -Manifest="C:\Users\Alice\Documents\Unreal Projects\tips\Intermediate\Build\Manifest.xml"
     -NoHotReload
     -log="C:\Users\Alice\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+SoftwareInstallation+EpicGames+UE_4.26\UBT-tips-Win64-Development.txt"
    
    • COOK COMMAND STARTED
    Running: 
    C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe
     "C:\Users\Alice\Documents\Unreal Projects\tips\tips.uproject"
     -run=Cook
     -TargetPlatform=WindowsNoEditor
     -fileopenlog
     -unversioned
     -createreleaseversion=1.0.0
     -abslog=C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Programs\AutomationTool\Saved\Cook-2021.05.24-16.21.35.txt -stdout
     -CrashForUAT
     -unattended
     -NoLogTimes
     -UTF8Output
    
    • STAGE COMMAND STARTED
    • PACKAGE COMMAND STARTED

RunUAT.bat script packaging

  • Through the above packaging log output Running AutomationTool part, you can replace RunUAT.bat to execute the script
  • When the project is too large, or the server performs packaging regularly, you can use RunUAT.bat for packaging
  • script template
    [EngineDir]\Engine\Build\BatchFiles\RunUAT.bat -ScriptsForProject="[ProjectDir]/ProjectName.uproject" BuildCookRun -nocompileeditor -installed -nop4 -project="[ProjectDir]/ProjectName.uproject" -cook -stage -archive -archivedirectory="[PackageDir]" -package -ue4exe=[EngineDir]\Engine\Binaries\Win64\UE4Editor-Cmd.exe -compressed -ddc=InstalledDerivedDataBackendGraph -pak -prereqs -nodebuginfo -targetplatform=Win64 -build -target=tips -clientconfig=Development -utf8output
    
  • Branches for easy reading of script templates
    [EngineDir]\Engine\Build\BatchFiles\RunUAT.bat
     -ScriptsForProject="[ProjectDir]/ProjectName.uproject"
     BuildCookRun -nocompileeditor -installed -nop4
     -project="[ProjectDir]/ProjectName.uproject"
     -cook -stage -archive
     -archivedirectory="[PackageDir]"
     -package
     -ue4exe=[EngineDir]\Engine\Binaries\Win64\UE4Editor-Cmd.exe
     -compressed
     -ddc=InstalledDerivedDataBackendGraph
     -pak -prereqs -nodebuginfo -targetplatform=Win64 -build
     -target=tips -clientconfig=Development -utf8output
    
  • practice
     C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat -ScriptsForProject="C:/Users/Alice/Documents/Unreal Projects/tips/tips.uproject" BuildCookRun -nocompileeditor -installed -nop4 -project="C:/Users/Alice/Documents/Unreal Projects/tips/tips.uproject" -cook -stage -archive -archivedirectory="C:/Users/Alice/Documents/Unreal Projects/tips" -package -ue4exe=C:\SoftwareInstallation\EpicGames\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe -compressed -ddc=InstalledDerivedDataBackendGraph -pak -prereqs -nodebuginfo -targetplatform=Win64 -build -target=tips -clientconfig=Development -utf8output
    

reference

Guess you like

Origin blog.csdn.net/ttod/article/details/127724787#comments_24312492
Recommended