Hey @nicotango88 and @AndrewDanileyko I have the same problem and could not solve it. If you have an idea what the issue is then please let me know. I am digging into this since days now without any success.
I was stepping through the code until I ended up in the
class FChunkDownloader::FPakMountWork : public FNonAbandonableTask
where in the void DoWork() function there is the following if statement:
if (FCoreDelegates::MountPak.IsBound())
which was not the case. So you can’t get past that if statement.
So the solution is to make sure the MountPak delegate is bound. To do so define this in your class:
TSharedPtr<FPakPlatformFile> PakPlatform;
class IPlatformFile* OriginalPlatform;
and before you do your patch operation:
// Store the platform file currently set
OriginalPlatform = &FPlatformFileManager::Get().GetPlatformFile();
// See if the pak platform is valid
if (!PakPlatform)
{
PakPlatform = MakeShareable<FPakPlatformFile>(new FPakPlatformFile());
}
// Initialize the pak platform file. This is where the MountPak delegate gets set.
PakPlatform->Initialize(&FPlatformFileManager::Get().GetPlatformFile(), TEXT(""));
// Set initialized Pak platform file
FPlatformFileManager::Get().SetPlatformFile(*PakPlatform.Get());
Now you will pass the if statement mentioned before because the MountPak delegate is set.
What you did is to tell the platform file system to treat Pak files now.
Important: After patching you need to set the original platform file again:
// Set the original platform file again after doing the pak file update.
FPlatformFileManager::Get().SetPlatformFile(*OriginalPlatform);
Otherwise the system thinks it should still treat pak files even if that is not the case anymore. The system can crash if you don’t set back the original platform file.
I hope this helps
For further explanations please have a look here. That link gave me the solution after digging through engine code for days and days:
I have .ucas and .utoc files generated and downloaded through ChunkDownloader.
But, it fails to mount .ucas and .utoc files, but it successfully mounts the .pak files, but at the end it sends a failure for mount complete callback.
Anyone knows how to solve this?
It seems like for the .ucas and .utoc files, the Decryptor is not valid.
@Kande Were you successful mounting the .ucas and .utoc files as well?
The .pak files gets mounted, and along with them is the .utoc files for those files.
.ucas files need not be mounted, it’s being referred through those .utoc and .pak files.
It gets mounted, after I checked the source code a bit.
But even if there is no change in the content, every build has a bit different size of .pak, .utoc and .ucas files. I don’t know why, but it’s observed.
Sounds like what I’m seeing too. I see all the unable to mount errors on the .utoc and .ucas files and it is organizing the files properly, plus content is fine. It just seems odd to throw those errors when it is fine. I guess a bug on Epic’s part.