Skip to content

Using the Packer and Bootstrapper

Dimitris Trachiotis edited this page Jan 4, 2021 · 1 revision

Packing the files

Before you pack the files of the game into Halva packages, you must export the game first. Once that's done, start the packer and follow the instructions.

To automate the Packer with a batch script, use the following: --SourceLocation "<inputlocation>" --Password <password> --OutputLocation "<outputlocation>"

The --Password and --OutputLocation are optional. Password is necessary to encrypt the packages, while the OutputLocation is used to put the packages in a different folder.

Preparing the bootstrapper

The Bootstrapper (necessary for unpacking the packages) will need some work before it's usable. You'll need the .NET SDK and either an IDE or a code editor.

  1. Open the PackageManager.cs file with the code editor (or open the .csproj file with your IDE of choice, and then open the .cs file in the IDE).
  2. In the property ExtractLocation, change the placeholder "RMDev" and "Game" to whatever you like.
  3. If you have set a password for the packages, look for the variable named PackagePassword. Put the password within the quotes.
  4. Open the Main.cs file. Change the "Game.exe" and "Game" (you'll find them in line 16) to the name of the executable (for example: "Harlod.exe", "Harold").
  5. Save the changes and close the code editor/IDE. Open the terminal (or command-line in Windows) and change over to the project's folder (cd <project-location>). Then type: dotnet publish -c Release -r <operating system's Runtime Identifier> (see .NET's documentation to see what's the Runtime Identifier for the OS you want). This will take a minute or two.
  6. Create a temporary folder and copy the contents of the published build (except the .pdb files). You'll find the files in bin/Release//publish.
  7. Create two folders within the temporary folder: Binaries and GamePackages.
  8. Put the packages created by the packer tool in the GamePackages folder.
  9. Put the nwjs' files in the Binaries folder. Since MV/MZ buts both the game files and nwjs in the same output folder, you'll need to copy only the binaries for nwjs.
  • For MV games, don't copy the www folder and the package.json file.
  • For MZ games, don't copy the folders: img, audio, data, fonts, icon, js and save. And do not copy the index.html and package.json files.
  • Downloading a "Normal" copy of nwjs is also an option (if you are using MV). If you use the RPG Maker MV Cook Tool, make sure that the version of the Normal and SDK match (or the game won't boot).

All that's left, is to zip it (or put the files in an installer) and publish. Before that, run the executable once (to make sure that it works).

Important notes:

  • It's a good idea to protect the password. Either loading an encrypted file for it, scrambling the password, or using an obfuscator are good options.
  • You can automate the file copying during build by either referencing the files in the .csproj file or by using a batch script.
  • To signify that updated packages are included in an update, edit the lines 38, 39, and 40 (in the GamePackages.cs file) and change the numbers. Make sure that the number is higher than the previous one.
  • Of course, feel free to customize the packer and the bootstrapper however you like. The source code is available on Github.
Clone this wiki locally