Is it possible to create pak files using FPakFile?

I’m working on create pak files recently and noticed that UrealPak.exe could make it. But I don’t know how to implement the function in my project yet. I found link text and link text very helpful, but am stuck in the details.And I’m wondering if it’s possible to pak my uasserts and umaps using FPakFile class.

You should use the UnrealPak file tool or just have it happen as part of your build process. Here’s the commandline I use to make a PAK file for a game here:

RunUAT BuildCookRun -project=“D:\dev\code\SomeProject.uproject” -WindowsNoEditor -cook -stage -clientconfig=Development -pak -manifests -build

I chose FMonitoredProcess class to implement the function as followings:

FString tempPathToExecutable = FPaths::EngineDir();
tempPathToExecutable.Append(FString(“Binaries\Win64\UnrealPak.exe”));

FString tempParam = FString(“UnrealPak amylindan.pak -Create=amylindan3 [compress]”);

aMonitor = new FMonitoredProcess(tempPathToExecutable, tempParam,false,true);

aMonitor->Launch();

However, it doesn’t work and i don’t know why.

gotcha:
I made a stupid mistake.The param should be FString(“amylindan.pak -Create=amylindan3 [compress]”);
And it works now.

Hi, I have implemented paking function using UnrealPak.exe so far. But Is it the only way to do it? Is there any other way?

I guess you could take the code from it and move it into a module, but there’s no out of the box solution

Ok, I see. Thanks a lot for answering. It’s really helpful.

One thing to remember is that anything you put in a PAK file should be the cooked data and not the original .usasset. PAK files are only used by final builds so they need to contain only cooked data for the target platform