How to use unreakpak to pak assets myself and set the mount point to relative path?

It may sounds stupid but now I want to do such things:
There is a packaged project with a single pak file. I want to unpak the pak file and repak the extracted files to several paks. For example, after extracting the pak file I can get two folder ProjectName/ and Engine/, and I want to pak them to ProjectName.pak and Engine.pak(Something like this).
But after repaking them, the mounting point becomes absolute path and can’t be mounted correctly. So how can I change the mounting point to relative path like “…/…/…/” or if I have other way to implements that?

Also interested in this question, would love to see some input from others!

Finally I find one magic(foolish) way…
When using UnrealPak, the mount point is the argument after -create=
So if I want to make the mount point of ProjectName.pak …/…/…/ProjectName, I should make three diretories x/xx/xxx under the Paks folder(or the folder where you extract your pak file to). Copy UnrealPak.exe and the needed dlls,modules or something(I copy all files named with UnrealPak) to the diretory. Then when running the UnrealPak.exe, the relative path “…/…/…/ProjectName” point to the folder, and the command " UnrealPak.exe pakName.pak -create=…/…/…/ProjectName" can pak the files under ProjectName to a pak file with mount point “…/…/…/ProjectName”.
Also you can split the whole asset to several paks, and just put them in the ‘Paks’ folder.

I succeed on Windows, but a little problem on Linux. I’m not sure if it’s the problem when compiling the UnrealPak under Linux, but in Linux, when I copy the UnrealPak to other folder, it doesn’t work.

Still I wonder whether there is a more elegant way…

Another way and may be the standard way?
Use txt file instead of the file path: “UnrealPak.exe PakName.pak -create=config.txt”
and the content in txt file is
“the absolute path of the files” “…/…/…/XXX”
then the mount point is “…/…/…/XXX”
there can be several files in one config.txt, like:
“D:/xxx/xxx/xx1.uasset” “…/…/…/XXX”
“D:/xxx/xxx/xx2.uasset” “…/…/…/XXX”
and also support directories:
“D:/xxx/xxx/*” “…/…/…/XXX”

Today (with 4.26.2) it wouldn’t work on Windows, even when copying all UnrealPak* files to current directory. I ended up copying the files to the UE directory instead:

.\UnrealPak.exe "C:\Users\xx\git\AnotherProject\Saved\StagedBuilds\Android_ASTC\AnotherProject\Content\Paks\pakchunk10010-Android_ASTC.pak" -Extract ..\..\..\CorrectProject\Content\Maps\FirstPersonExampleMap\
.\UnrealPak.exe "C:\Users\xx\git\AnotherProject\Saved\StagedBuilds\Android_ASTC\AnotherProject\Content\Paks\pakchunk10010-Android_ASTC.pak" ..\..\..\CorrectProject\Content\Maps\FirstPersonExampleMap\
.\UnrealPak.exe "C:\Users\xx\git\AnotherProject\Saved\StagedBuilds\Android_ASTC\AnotherProject\Content\Paks\pakchunk10010-Android_ASTC.pak" -List
rm ..\..\..\CorrectProject\Content\Maps\FirstPersonExampleMap\*

One way you can use UnrealPak.exe to packagin is
%UnrealPak% %PakFilename% -create=%ResponseFile%
where is the path of UnrealPak.exe, %PakFilename% is the path of the pak to create and %ResponseFile% can be the path of a .txt file which contains the list of files to package. But this txt file needs to have a format, here is an example

“D:\MyProject\PakAdmin\ExtractedData\MyProject\MyProject.uproject” “…/…/…/MyProject/MyProject.uproject” -compress
“D:\MyProject\PakAdmin\ExtractedData\Engine\Content\Slate\Testing\Wireframe.png” “…/…/…/Engine/Content/Slate/Testing/Wireframe.png” -compress
“D:\MyProject\PakAdmin\ExtractedData\MyProject\Content\Art\Sounds\SND_Card_Tap.ubulk” “…/…/…/MyProject/Content/Art/Sounds/SND_Card_Tap.ubulk” -compress

You can see that the left side is the file location and the right side is the mount point of each file