How to use unrealpak.exe to build pak

i want to use unrealpak.exe to build pak, only with one file, which command line i can use ? and i want compress it, which param can use?

If you run UnrealPak.exe without any parameters, it shows this usage:

Usage:
UnrealPak <PakFilename> -Test
UnrealPak <PakFilename> -List
UnrealPak <PakFilename> <GameUProjectName> <GameFolderName> -ExportDependencies=<OutputFileBase> -NoAssetRegistryCache -ForceDependsGathering
UnrealPak <PakFilename> -Extract <ExtractDir>
UnrealPak <PakFilename> -Create=<ResponseFile> [Options]
UnrealPak <PakFilename> -Dest=<MountPoint>
UnrealPak GenerateKeys=<KeyFilename>
UnrealPak GeneratePrimeTable=<KeyFilename> [-TableMax=<N>]
UnrealPak <PakFilename1> <PakFilename2> -diff
UnrealPak -TestEncryption
Options:
  -blocksize=<BlockSize>
  -bitwindow=<BitWindow>
  -compress
  -encrypt
  -order=<OrderingFile>
  -diff (requires 2 filenames first)
  -enginedir (specify engine dir for when using ini encryption configs)
  -projectdir (specify project dir for when using ini encryption configs)
  -encryptionini (specify ini base name to gather encryption settings from)
  -encryptindex (encrypt the pak file index, making it unusable in unrealpak without supplying the key)

In your case, you would want to run:

> Engine\Binaries\Win64\UnrealPak.exe X:\dest\somepak.pak -Create=X:\source\ -compress
1 Like

thank you~ but -Create=X:\source\ is package the all dir, i want to package only one file…

So only put one file in that ‘source’ folder, or ALL files from the original pak and the NEW ONE in place. …

Sorry I just saw your reply! You can set -Create=X:\responsefile.txt. Inside you can write patterns for which files are added to the pak, and you can even rebase (change the filepaths of) the files that get discovered.

How to write a responsefile is documented a bit here: https://www.cnblogs.com/linqing/p/5100518.html

Excerpt:

UnrealPak.exe D:\MyAssetPak.pak -create=PathToResponseFile.txt

where the ResponseFile could be:

Code:

..\..\..\Engine\Content\Editor\Slate\*.*
..\..\..\Engine\Content\Localization\*.*
..\..\..\Engine\Shaders\*.*
..\..\..\Engine\config\*.*
PathToYourProject\*.uproject
PathToYourProject\Config\*.*
PathToYourProject\Content\Localization\*.*
PathToYourProject\Saved\Sandboxes\Cooked-WindowsNoEditor\Engine\*.* ..\..\..\Engine\*.*
PathToYourProject\Saved\Sandboxes\Cooked-WindowsNoEditor\ProjectName\*.* ..\..\..\ProjectName\*.*

Note that the last two lines re-base the content from Cooked folder to Content folder.