Skip to content

2.4 ‐ Updating Ruby Codes in the Compiled Executable

Z-H-Sun edited this page Jan 16, 2024 · 1 revision

Technically, the Ruby codes are not compiled; it's just the Ruby interpreter gets compiled, and it executes the Ruby codes which are stored as data resources in the packed executable. Therefore, if we make changes to the Ruby codes, there is no need to re-compile the whole thing, but rather, we can just update the data resources in the executable according to the new Ruby codes.

Moreover, the tools introduced in this article can also change the version info, icon, and manifest in the executable file.

Prerequisites

Run

Navigate to the compile folder, and double click on updateExe.rb. Then you are done!

Additional Notes

You may want to take a look at the contents of updateExe.rb and make some changes to the ICOFILE, MANFILE, and VER constants according to your needs, so that you can also update the version info, icon, and manifest, respectively, in the executable file.

The compression of the Ruby codes into an archive is implemented in mkexa.rb. This can be potentially used in your own projects if you want to convert your Ruby codes into a sharable executable and publish it.