# Distributing Windows WxRuby apps

**URL:** <https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366>\
**Category:** wxRuby\
**Created:** [March 19, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366 "2009-03-19T16:44:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 19, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/1 "2009-03-19T16:44:08Z")

</div>

I’ve developed a WxRuby app that only runs under Windows. I’ve been  
using  
RubyScript2exe to build an executable for distribution, but it stopped  
working one day and I haven’t been able to figure out why. I’m also not  
very confident that it will work when I go to Ruby 1.9.

What other options do I have? I could use InstallShield, or something  
like  
it to install ruby.exe along with my .rb files and any DLLs, etc. that I  
may  
need. Someone suggested that I switch to IronRuby and run my app with  
.NET’s DLR. Does WxRuby work with IronRuby?

How are other people distributing WxRuby app on Windows?

Eric R.

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 19, 2009, 4:56pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/2 "2009-03-19T16:56:26Z")

</div>

Hi Eric

Eric R. wrote:

> I’ve developed a WxRuby app that only runs under Windows. I’ve been  
> using RubyScript2exe to build an executable for distribution, but it  
> stopped working one day and I haven’t been able to figure out why.

Try packaging it so that error messages are put to the console and run  
it from the terminal. It should show what’s wrong.

> What other options do I have?

[http://rubyforge.org/pipermail/wxruby-users/2008-October/004248.html](http://rubyforge.org/pipermail/wxruby-users/2008-October/004248.html)

> I could use InstallShield, or something like it to install ruby.exe  
> along with my .rb files and any DLLs, etc. that I may need. Someone  
> suggested that I switch to IronRuby and run my app with .NET’s DLR.  
> Does WxRuby work with IronRuby?

Not AFAIK.

> How are other people distributing WxRuby app on Windows?

I described how I do it here.  
[http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html](http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html)

cheers  
alex

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 30, 2009, 2:08pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/3 "2009-03-30T14:08:26Z")

</div>

How long before you figure there will be a bytecode compiler deal (a  
la kava for perl) for 1.9? I would imagine this is one of the big  
giant reasons to use 1.9.

– Eric W.

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 30, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/4 "2009-03-30T15:12:25Z")

</div>

Eric W. wrote:

> How long before you figure there will be a bytecode compiler deal (a  
> la kava for perl) for 1.9? I would imagine this is one of the big  
> giant reasons to use 1.9.

You can already save and load compiled instructions for the Ruby 1.9  
virtual machine, using the VM::InstructionSequence class in Ruby core.  
However in the ruby distribution the method VM::InstructionSequence.load  
is disabled, but if you uncomment the relevant line (in iseq.c, near the  
end) and compile ruby, you can run ruby from saved VM instructions. I’ve  
tried it (to a limited extent) and it works.

The reason it’s disabled is ‘there is no verifier’ - which I believe in  
part reflects concern about cross-version compatibility of VM  
instructions - but if you’re distributing your own Ruby with your GUI  
app, this may not matter.

a

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 30, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/5 "2009-03-30T16:18:20Z")

</div>

On Mon, Mar 30, 2009 at 9:06 AM, Alex F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You can already save and load compiled instructions for the Ruby 1.9 virtual  
> machine, using the VM::InstructionSequence class in Ruby core. However in  
> the ruby distribution the method VM::InstructionSequence.load is disabled,  
> but if you uncomment the relevant line (in iseq.c, near the end) and compile  
> ruby, you can run ruby from saved VM instructions. I’ve tried it (to a  
> limited extent) and it works.

That’s very interesting, but not totally what I’m looking for. Kava  
for Perl is a total packager into an exe. Perhaps it compiles the  
bytecode and compresses the interpreter into an exe, I’m not sure.  
RubyScript2Exe is unacceptably slow, so if “extract exe and all  
libraries every time” is still the way to go, I can’t use that. The  
users of my GUI apps have no admin rights on their computers so I  
can’t install Ruby (or anything else). They only thing they can write  
to is a home directory on a network share. Right now I just have a  
version of Ruby shared on the network and we use that to run things,  
but it sucks.

– Eric W.

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 30, 2009, 9:16pm UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/6 "2009-03-30T21:16:37Z")

</div>

Eric W. wrote:

> That’s very interesting, but not totally what I’m looking for. Kava  
> for Perl is a total packager into an exe. Perhaps it compiles the  
> bytecode and compresses the interpreter into an exe, I’m not sure.  
> RubyScript2Exe is unacceptably slow, so if “extract exe and all  
> libraries every time” is still the way to go, I can’t use that. The  
> users of my GUI apps have no admin rights on their computers so I  
> can’t install Ruby (or anything else). They only thing they can write  
> to is a home directory on a network share.

To get round this - esp the time taken to unzip the ruby interpreter  
plus the (not small) wxruby libs plus everything else, I create a  
Windows installer using NSIS which installs a custom ruby, the ruby .dll  
and all the ruby library files needed. There’s some more details and  
links to the implementation code here:

[http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html](http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html)

a

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 31, 2009, 12:26am UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/7 "2009-03-31T00:26:32Z")

</div>

I saw, but I can’t install anything on these machines.

–  
Eric W. / rakaur @ malkier

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 31, 2009, 8:09am UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/8 "2009-03-31T08:09:00Z")

</div>

Eric W. wrote:

> I saw, but I can’t install anything on these machines.
> 
> > Eric W. wrote:
> > 
> > > They only thing they can write  
> > > to is a home directory on a network share.

Write permission to somewhere is enough to install with this approach.  
It uses a self-contained Ruby, so nothing needs to go in any system  
directory, and no changes to PATH are needed. I don’t have admin rights  
on my work machine but this don’t prevent me installing this way.

Try using the Weft QDA 1.9 installer and setting the target directory to  
X:/MyStuff/Weft (or whatever your networked home dir is called):

[http://rubyforge.org/frs/download.php/35715/weft-qda-install-1.9.0.exe](http://rubyforge.org/frs/download.php/35715/weft-qda-install-1.9.0.exe)

it’s only an alpha release but it should allow you to assess the  
viability of this approach.

a

---

<div class="post-metadata">

**Author:** ![erubin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/82dd89/32.png) [@erubin](https://www.ruby-forum.com/u/erubin)\
**Post date:** [March 31, 2009, 5:50am UTC](https://www.ruby-forum.com/t/distributing-windows-wxruby-apps/163366/9 "2009-03-31T05:50:07Z")

</div>

I wish to point out another option, that I’ve come across dealing with  
something of other sorts. PortableApps. [http://www.portableapps.com](http://www.portableapps.com),  
They  
use a NSIS Script, that doesn’t actually install anything, but creates  
an  
Environment to execute a program, to keep it portable. If you look at  
the  
contents of one of their programs, you’ll see that the actual  
application is  
stored into a folder named apps, while the actual executable used to  
launch  
the application, is just an NullSoft Installer executable.

Specifically look at this page, at Step 4:

> **[Development | PortableApps.com](https://portableapps.com/development)**
>
> The PortableApps.com Development section is designed to provide resources to developers working with portable applications - both adaptations of existing apps as well as original apps designed to be portable. Packaging Portable Apps These links are...
