panzi/rust-u4pak

Packing adds files to .pak with filepath "[filename]/[folder]" instead of "[folder]/[filename]"

Closed this issue · 2 comments

Not sure if this is a bug or something I'm doing wrong, everything I've tried with rust-u4pak seems to result in the title.

My file layout is like so:

  • \u4pak.exe
  • \ext\BendGame\BendGame.uproject
  • \ext\BendGame\Content\...
  • \ext\Engine\Content\...

So far I've tried the following commands to pack them:

  • u4pak pack --mount-point=../../../ BendGame-WindowsNoEditor.pak ext - results in filenames like BendGame/BendGame.uproject/ext
  • u4pak pack --mount-point=../../../ BendGame-WindowsNoEditor.pak :none,rename=/BendGame:ext\BendGame :none,rename=/Engine:ext\Engine - results in filenames like BendGame.uproject/BendGame, instead of BendGame/BendGame.uproject
  • cd ext; ..\u4pak pack --mount-point=../../../ BendGame-WindowsNoEditor.pak BendGame Engine - also results in filenames like BendGame.uproject/BendGame

For reference, I'm using Win10 for this, just trying to repack extracted contents of Days Gone into an uncompressed .pak, unfortunately game didn't seem to work with any of the .pak files generated above.

Eventually I tried using the older u4pak.py script with python u4pak.py pack --mount-point ../../../ BendGame-WindowsNoEditor.pak BendGame Engine, seemed to create a .pak the game could work with, and filenames in that pak seem correct, still thought it was worth bringing it up here seeing as u4pak.py is the older version.

E: of course, just after I make an issue about it I find how to get it working: u4pak pack --mount-point=../../../ BendGame-WindowsNoEditor.pak :none,rename=/:ext\ seems to create a .pak with correct filenames, and game runs fine with it.

Still, I don't think using rename should be required here, feels more like a workaround to me... [filename]/[folder] isn't really that common in UE4 titles (if any?), so not sure why it'd be the default.

panzi commented

Oh thanks for reporting this! Going to look into it!

panzi commented

Ok, fixed it and made a bugfix release: https://github.com/panzi/rust-u4pak/releases/tag/v1.2.1

The reason why I didn't notice was because I only tested like this:

u4pak pack --mount-point=../../../ BendGame-WindowsNoEditor.pak :rename=/:ext

Which worked anyway. Oops.