Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject file into package #22

Open
dustekin opened this issue Jul 17, 2023 · 5 comments
Open

Inject file into package #22

dustekin opened this issue Jul 17, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@dustekin
Copy link

Is there a command line sequence to allow me to inject files in a hpk package giving the path within the package?

Example Jagged Alliance 3 -

Say we have a folder C:\something\UI\Mercs unpacked from UI.hpk. I modify the files in \Mercs. I then have a couple of files, and I know their paths. Can I skip repacking the folder?

Down the line I want to create a bat to inject a selection of files into UI.hpk and distribute it with the modified files, but only the modified files. Is there a way to inject files with the .bat or do I have to run commands to unpack, overwrite and repack.

I looked through your documentation but I'm stuck.

@nickelc
Copy link
Owner

nickelc commented Jul 17, 2023

Editing files is currently not possible. You can only recreate them.

I could think of a merge or concat command that is doing the unpacking, overwriting and repack steps.
Editing would be nice but is more complicated than combining the existing code for a merge command.

@dustekin
Copy link
Author

A merge function would be really useful.

Just to be clear, I want to distribute a zip with only the modified files and a bat inside it, plus maybe your hpk package as a mod package so a user can just put the zip content into the same folder as the .hpk file and run it. I don't want to provide the 1GB sized asset package with a couple of change megabytes of files.

@nickelc
Copy link
Owner

nickelc commented Jul 18, 2023

If you can compile it then you can test the new hpk merge command from the merge-command branch.

hpk merge --dont-compress-files a.hpk b.hpk c.hpk output.hpk
Merge a new hpk archive

Usage: hpk merge [OPTIONS] <input>... <output>

Arguments:
  <input>...  input files
  <output>    hpk output file

Options:
      --compress
          Compress the whole hpk file
      --chunk-size <SIZE>
          Default chunk size: 32768
      --with-filedates
          Stores the last modification times in a _filedates file
      --filedate-fmt <FORMAT>
          Specifies the format of the stored filedates.

          default: 'Windows file time' used by Tropico 3 and Grand Ages: Rome
          short: 'Windows file time / 2000' used by Tropico 4 and Omerta
      --dont-compress-files
          No files are compressed. Overrides `--extensions`
      --extensions <EXT>...
          Specifies the file extensions to be compressed. default: [lst,lua,xml,tga,dds,xtex,bin,csv]
      --lz4
          Sets LZ4 as encoder
  -h, --help
          Print help (see more with '--help')

@nickelc
Copy link
Owner

nickelc commented Jul 19, 2023

Or you can find the build artifacts from the branch in the actions runs https://github.com/nickelc/hpk/actions/runs/5596777024.

image

@dustekin
Copy link
Author

Cool! I'm working on modding the files and will test when I can. You rock!

@nickelc nickelc added the enhancement New feature or request label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants