Hi Andy,
Thanks! First up, thanks for your awesome work on Glimmer! I try to do some writing about RubyOnWindows and that includes JRuby; in that, I have had the Glimmer site open in my browser for a few months because I really want to use it and write about how Ruby + JRuby + Rails + Glimmer offer very different options for developers to use.
Now, to what you wrote
Other than the option already mentioned by others of including exe
files as ".executables = [file.exe]" in the gemspec, you could package
an entire Ruby app as a native executable distributed as a Mac DMG/PKG
file or Windows MSI/EXE file.
I only know about packaging JRuby native applications well enough
since my open-source project Glimmer DSL for SWT
(GitHub - AndyObtiva/glimmer-dsl-swt: Glimmer DSL for SWT (JRuby Desktop Development Cross-Platform Native GUI Framework) - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer!) includes automated
packaging functionality
(https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md)
for DMG/PKG on Mac and MSI/EXE on Windows.
I will read that link and see if it can help in our current problem.
If your code can run well
in JRuby and you do not need a quick startup time (JRuby takes 5-10
seconds to start), then that can be an option (for example, an app
that only needs to be started in the morning and left on all day would
be a good fit for this option).
I'm familiar with JRuby and in fact, I have a small post that talks about how to package a JRuby JAR based on Ruby code.
However, this application misses a few criteria:
-> we run the application on schedule every minute. The 3 ~ 5 seconds of JRuby startup are a problem till we migrate to a daemon mode for the application where it starts once, runs forever
-> specifically, we need a few Windows binaries to be included into the package
-> finally, we currently use a couple of native gems like Ox which we would need to replace.
That said, for standard CRuby packaging, OCRA is often recommended for
Windows (GitHub - larsch/ocra: One-Click Ruby Application Builder). In fact, it is mentioned on
my new open-source CRuby GUI project's page: Glimmer DSL for LibUI
(GitHub - AndyObtiva/glimmer-dsl-libui: Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer! - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works on Mac, Windows, and Linux.), but I am
no expert in it. Perhaps someone else experienced with it could talk
more about it.
I have experience with Ocra and it won't help in this case much since it handles the packaging of all the stuff into a single package, then unzips to temp and runs it - similar to JRuby's approach.
For me, the specific problem I was trying to solve is:
* I have some Windows EXE files that are called from our Ruby gem using system('myexe.exe input output')
* I'm seeking the best (Rubyist) way of delivering these with our gem (specifically to Windows users)
I imagine the options I have received will help with this problem and I might need to look up how to create fat gems since those can be specific to a platform and also include binaries.
I will report back.
Best Regards,
Mohit.
···
On 2021-10-19 11:43 am, Andy Maleh wrote: