I know this was talked about briefly a while ago, but
I wasn’t paying attention I need to distribute my
application to a wide audience of non-technical
Windows users. What is the best way to go?
I’ve made gems (it’s all pure ruby) so for Linux
people it’s pretty easy just to install ruby, ruby-gnome
and then install the gems. But for Windows
users, I’d like to avoid the 23 meg “Single Click
Ruby” download. Also, I’m not sure how to install
the latest ruby-gnome bindings on Windows even
myself.
I took a look at tar2rubyscript and rubyscript2exe,
and they look useful, but I’m still left with no easy
way to get ruby-gnome installed.
I seem to remember that Mathieu mentioned a
potential solution (Hi!, BTW – Yes, I’m finally releasing
a new version of JLDrill )
I don’t necessarily mind asking the users to install
ruby and ruby-gnome so if I can find an easy way to
do that (and a slightly less kitchen-sink install for
ruby) and an easy way to install my gems, then
that would be fine too.
Thanks in advance for any help!
MikeC
P.S. And after all that, I also want an easy way to
do the same for OSX. But Windows is higher priority
right now.
My approach for my program was a little bit of a brute-force approach:
package everything necessary into one big zip file. This includes
Ruby, GTK, and RG2. The user can unpack the zip file anywhere on his
computer.
I uninstalled Ruby and GTK to make sure that my package would work
even if the user doesn’t have them installed.
I made an executable whose role is to run the command “rubyw
/path/to/myapp.rb”. You can see it as a “process launcher”. I made an
executable because this is the only way I found to hide the command
prompt that is displayed if you use a .bat file.
myapp.rb updates the ruby load path and the windows path to include
the path of ruby dependencies and GTK dlls. I concatenated #{Dir.pwd}
with relative paths so that this works anywhere.
For the dlls that GTK loads at runtime, I replaced absolute paths
with relative paths in the GTK configuration files generated by the
gladewin32 installer.
Pros and cons of my approach:
The final package can be pretty big! However you can gain a lot of
space by removing unnecessary libs from the Ruby stdlib and removimg
po files from GTK2. (I didn’t try to reduce the size in my case)
The load is much faster than a program generated by rubyscript2exe.
This is because rubyscript2exe unpacks the content embedded in to the
.exe file at every start while with my approach all the content is
already on the hard disk.
When I need to do a new release of my software, unless I want to
upgrade Ruby or GTK, I take the previous release, replace my
application folder and that’s it!
Since installing the software is simply a matter of unzipping the
package, this may be confusing for people who would expect an
installer (this pretty much the standard way of installing software in
Windows). Plus, menu and desktop shortcuts are not created. Therefore
it may be interesting to combine this approach with a NSIS installer.
I made an executable whose role is to run the command “rubyw
/path/to/myapp.rb”. You can see it as a “process launcher”. I made an
executable because this is the only way I found to hide the command
prompt that is displayed if you use a .bat file.
Hi:
this is the same i do, but the exe what kind of API use to launch the
rubyw??