[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

A general doubt

Rock Roll

8/28/2008 5:23:00 PM

If I am developing a Windows application in Ruby using FxRuby or WxRuby,
compile and create the executable, will i need ruby in another computer
in order to run the standalone application? Sorry if my question is so
silly.
--
Posted via http://www.ruby-....

27 Answers

Michael Morin

8/28/2008 5:40:00 PM

0

Rock Roll wrote:
> If I am developing a Windows application in Ruby using FxRuby or WxRuby,
> compile and create the executable, will i need ruby in another computer
> in order to run the standalone application? Sorry if my question is so
> silly.

It's not silly, it's a genuine concern. Having users install Ruby and a
handful of libraries just to run your program is a concern, especially
if they're not computer savvy. Giving them a standalone exe will be
much better.

I've never done this on Ruby, but I have with a few Perl programs.
There were some programs like "perl to exe" that would bundle your Perl
programs, any required libraries, etc with a perl interpreter into a
self-extracting exe. You simply ran the exe to run the program. A
quick google tells me something like this exists for Ruby:

http://www.erikveen.dds.nl/rubys...

But I'm sure someone here has done this and can give you some more
specific advice.

--
Michael Morin
Guide to Ruby
http://ruby....
Become an About.com Guide: beaguide.about.com
About.com is part of the New York Times Company

Adam Shelly

8/28/2008 5:53:00 PM

0

On 8/28/08, Michael Morin <uzimonkey@gmail.com> wrote:
> Rock Roll wrote:
> > If I am developing a Windows application in Ruby using FxRuby or WxRuby,
> > compile and create the executable, will i need ruby in another computer
> > in order to run the standalone application? Sorry if my question is so
> > silly.
> >
> I've never done this on Ruby, but I have with a few Perl programs. There
> were some programs like "perl to exe" that would bundle your Perl programs,
> any required libraries, etc with a perl interpreter into a self-extracting
> exe. You simply ran the exe to run the program. A quick google tells me
> something like this exists for Ruby:
>
> http://www.erikveen.dds.nl/rubys...
>
> But I'm sure someone here has done this and can give you some more specific
> advice.
>
I have used rubyscript2exe with FxRuby, and it works fine. (Startup
can be a little slow, as it unpacks a bunch of stuff to a temporary
directory, but after that it works great.)

-Adam

Lex Williams

8/28/2008 6:03:00 PM

0

Adam Shelly wrote:
> On 8/28/08, Michael Morin <uzimonkey@gmail.com> wrote:
>> something like this exists for Ruby:
>>
>> http://www.erikveen.dds.nl/rubys...
>>
>> But I'm sure someone here has done this and can give you some more specific
>> advice.
>>
> I have used rubyscript2exe with FxRuby, and it works fine. (Startup
> can be a little slow, as it unpacks a bunch of stuff to a temporary
> directory, but after that it works great.)
>
> -Adam

but,what if I don't want the end-user to be able to see the source code
of the script ?
--
Posted via http://www.ruby-....

Thomas Wieczorek

8/28/2008 6:24:00 PM

0

On Thu, Aug 28, 2008 at 8:03 PM, Lex Williams <etaern@yahoo.com> wrote:
>
> but,what if I don't want the end-user to be able to see the source code
> of the script ?
>

You might try to obscure the code, but it will be still available in
the Application Data folder of the user. I don't believe much in
obfuscation.
Another way would be to develop in JRuby and compile it. I am not sure
if there will be class files or rb files(Anyone else?)
I just got started with JRuby and Swing with Monkeybars[1] and Rawr.
You can find some great screencasts on their site.

[1] http://monkeybars.ruby...

Rock Roll

8/28/2008 6:25:00 PM

0

Lex Williams wrote:
> Adam Shelly wrote:
>> On 8/28/08, Michael Morin <uzimonkey@gmail.com> wrote:
>>> something like this exists for Ruby:
>>>
>>> http://www.erikveen.dds.nl/rubys...
>>>
>>> But I'm sure someone here has done this and can give you some more specific
>>> advice.
>>>
>> I have used rubyscript2exe with FxRuby, and it works fine. (Startup
>> can be a little slow, as it unpacks a bunch of stuff to a temporary
>> directory, but after that it works great.)
>>
>> -Adam
>
> but,what if I don't want the end-user to be able to see the source code
> of the script ?

Ya. I too have doubt in the expose of .rb files to the end user.

I installed Weft-Qda( www.pressure.to/qda/ ) which is s qualitative
analysis software application which is built using ruby. After
installation i saw the .rb files inside the installation directory. They
could be easily changed by the user or if any hacker gets access to the
user's computer..

--
Posted via http://www.ruby-....

Alex Fenton

8/28/2008 6:33:00 PM

0

Lex Williams wrote:
> Adam Shelly wrote:
>> On 8/28/08, Michael Morin <uzimonkey@gmail.com> wrote:
>>> something like this exists for Ruby:
>>>
>>> http://www.erikveen.dds.nl/rubys...
>>>
>>> But I'm sure someone here has done this and can give you some more specific
>>> advice.
>>>
>> I have used rubyscript2exe with FxRuby, and it works fine. (Startup
>> can be a little slow, as it unpacks a bunch of stuff to a temporary
>> directory, but after that it works great.)

Rubyscript2exe is an easy and pretty effective solution for both wxRuby
and FxRuby. It's not perfect though, startup time being one of the
problems as the whole package gets bigger.

For more complicated applications, you can instead package up ruby.exe,
the compiled ruby runtime and all the needed .rb files (you can find
this out by inspecting $LOADED_FEATURES) and then using something like
NSIS to install this minimal environment on the end user's machine.

> but,what if I don't want the end-user to be able to see the source code
> of the script ?

Neither rubyscript2exe nor the other method I describe provide any
protection. Ruby remains an interpreted and highly dynamic language so
it's difficult to find any very effective scheme to distribute without
source.

Perhaps the nearest you can get at the moment with MRI is to use 1.9 and
its RubyVM classes to distribute code as opcodes.

There may be more options available with JRuby, but of course FXRuby and
WxRuby aren't available there; you'll need to use SWING etc for the GUI.

alex

Alex Fenton

8/28/2008 6:41:00 PM

0

Rock Roll wrote:
> Lex Williams wrote:
>> but,what if I don't want the end-user to be able to see the source code
>> of the script ?
>
> Ya. I too have doubt in the expose of .rb files to the end user.
>
> I installed Weft-Qda( www.pressure.to/qda/ ) which is s qualitative
> analysis software application which is built using ruby. After
> installation i saw the .rb files inside the installation directory. They
> could be easily changed by the user or if any hacker gets access to the
> user's computer..

Weft QDA's an open-source product aimed at end-users so the fact that
the source is accessible in the installation directory of the source
isn't a problem.

Even with a compiled product, if the user starts tinkering with the
program's files in C:/Program Files/ they might expect trouble, and if a
hacker has access to their local file system, they've got more to worry
about in general ...

It would be nice in some circumstances to properly obscure the ruby
source, but RubyScript2Exe definitely isn't it. It solves other problems
quite well though, even though for Weft QDA I've moved away from using it.

alex

Michael Morin

8/28/2008 6:41:00 PM

0

Lex Williams wrote:
> Adam Shelly wrote:
>> On 8/28/08, Michael Morin <uzimonkey@gmail.com> wrote:
>>> something like this exists for Ruby:
>>>
>>> http://www.erikveen.dds.nl/rubys...
>>>
>>> But I'm sure someone here has done this and can give you some more specific
>>> advice.
>>>
>> I have used rubyscript2exe with FxRuby, and it works fine. (Startup
>> can be a little slow, as it unpacks a bunch of stuff to a temporary
>> directory, but after that it works great.)
>>
>> -Adam
>
> but,what if I don't want the end-user to be able to see the source code
> of the script ?

You can't really do that, the best you can do is obfuscation. Even
then, a skilled person can de-obfuscate the code or otherwise reverse
engineer it. All you do is raise the bar a little bit, you don't
prevent anyone from doing anything.

Strictly speaking, all software is open source. You cannot hide the
source code to your application, only translate it into something less
human readable. Also, in almost all cases, preventing someone from
reading the code in the first place is a useless endeavor. Only where
something like trade secrets and industrial espionage is a factor does
hiding your source code make sense.

--
Michael Morin
Guide to Ruby
http://ruby....
Become an About.com Guide: beaguide.about.com
About.com is part of the New York Times Company

Rock Roll

8/28/2008 6:47:00 PM

0

Michael Morin wrote:

> You can't really do that, the best you can do is obfuscation. Even
> then, a skilled person can de-obfuscate the code or otherwise reverse
> engineer it. All you do is raise the bar a little bit, you don't
> prevent anyone from doing anything.
>
> Strictly speaking, all software is open source. You cannot hide the
> source code to your application, only translate it into something less
> human readable. Also, in almost all cases, preventing someone from
> reading the code in the first place is a useless endeavor. Only where
> something like trade secrets and industrial espionage is a factor does
> hiding your source code make sense.


Thank you. But when a hacker who knows the internals of the software
gets access to the software in an End user's computer, and if he changes
the code after getting root access wont that harm the user's computer
and when he knows that the software is damaged or causing some trouble
wont he blame the makers


--
Posted via http://www.ruby-....

James Britt

8/28/2008 8:43:00 PM

0

Thomas Wieczorek wrote:
> On Thu, Aug 28, 2008 at 8:03 PM, Lex Williams <etaern@yahoo.com> wrote:
>> but,what if I don't want the end-user to be able to see the source code
>> of the script ?
>>
>
> You might try to obscure the code, but it will be still available in
> the Application Data folder of the user. I don't believe much in
> obfuscation.
> Another way would be to develop in JRuby and compile it. I am not sure
> if there will be class files or rb files(Anyone else?)

I've a fork of rawr while I work on adding .rb-to-.class -> jar behavior
so that you can pre-compile the ruby files as .class files, all bundled
into a jar.

http://gitorious.org/projects/rawr/repos/jamesbr...

When it's working and tested it will get rolled in rawr proper.




--
James Britt

www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff