The if you package from a different project, you have the problem of the MountPath that is within the package. The mount path contains the project name. You need to modify that path to be the name of the project where you mount it.
Output from UnrealPak.exe
C:\Users\vr3> "C:\Program Files\Epic Games\UE_4.19\Engine\Binaries\Win64\UnrealPak.exe" "C:\Users\vr3\Documents\PackagingDir\Mods\WindowsNoEditor\MyFirstModTest\Plugins\FistModPlugin\Content\Paks\WindowsNoEditor\FistModPlugin.pak" -list
LogPakFile: Display: Using command line for crypto configuration
LogPakFile: Display: Mount point ../../../MyFirstModTest/
LogPakFile: Display: "CookedAssetRegistry.json" offset: 0, size: 24560 bytes, sha1: 0CB9C512B052215EA6A82B8685A727B333AEF345.
LogPakFile: Display: "CookedIniVersion.txt" offset: 26624, size: 48481 bytes, sha1: E45F6515C15E4A896DC8B8D65416E3FEC8B5EBD7.
LogPakFile: Display: "Plugins/FistModPlugin/AssetRegistry.bin" offset: 75776, size: 21474 bytes, sha1: 25209C5DB806E659EC39F8BD6FF8D8E80F03D71B.
LogPakFile: Display: "Plugins/FistModPlugin/DevelopmentAssetRegistry.bin" offset: 98304, size: 35984 bytes, sha1: A0594AB0E5A56D9EEE56954351F527D484FE81AA.
LogPakFile: Display: 4 files (130499 bytes), (130499 filtered bytes).
LogPakFile: Display: Unreal pak executed in 0.011382 seconds
LogPakFile: Display: Mount point ../../../**MyFirstModTest**/
is the project name in the mount path. The path can be longer, but that should be the minimum there is.
You need to get the mount point and modify it. You need to mount manually this way.
Some code snippets that should help you out.
It took me a month to get the stuff working for us, so keep it easy.
Get the PakPlatformFile
if (pakPlatformFile == nullptr)
{
// Search for an existing pakPlatformFile
IPlatformFile* existingPakPlatformFile = FPlatformFileManager::Get().FindPlatformFile(TEXT("PakFile"));
if (existingPakPlatformFile)
{
pakPlatformFile = static_cast<FPakPlatformFile*>(existingPakPlatformFile);
CM_LOG(Log, "Using existing PakPlatformFile");
}
else
{
// When mounting a .pak file, we need to store a references to the .pak file in the platform file system.
// To do this, we need a FPakPlatformFile that allows us to mount our .pak and keeps the information about the package.
pakPlatformFile = new FPakPlatformFile();
// But we don't want the engine to lose information of other packages
// (and what ever other stuff), thus get the current PlatformFile
IPlatformFile& platformFile = FPlatformFileManager::Get().GetPlatformFile();
// and place it into our new PlatformFile (PlatformFile-Chain).
if (!pakPlatformFile->Initialize(&platformFile, TEXT("")))
{
CM_LOG(Fatal, "Failed to initialize PakPlatformFile");
}
// Not sure about this, see: https://answers.unrealengine.com/questions/574388/how-to-mount-a-pak-file-at-game-content-directory.html
pakPlatformFile->InitializeNewAsyncIO();
// Now give the new PlatformFile to the engine.
FPlatformFileManager::Get().SetPlatformFile(*pakPlatformFile);
CM_LOG(Log, "Using our own PakPlatformFile");
}
}
Get the mount point of the .pak file
// Get the mount point
FPakFile pak(pakPlatformFile->GetLowerLevel(), *file, bSigned);
pak.GetMountPoint();
Now modify the mount point retrieved.
Mount the .pak file manually
pakPlatformFile->Mount(*file, readOrder, *mountPointFinal)