List Info

Thread: Creating an executable




Creating an executable
user name
2007-02-02 01:46:09
Hi,

I want to create an executable program that include all the
necessary
modules in it, so it can run without needing other files.
I want to do this for protecting the source code.

The problem is that the program is made using Catalyst
framework and it
doesn't work without the .pm modules.

I have tried creating an executable from the
script/myapp_server.pl program
from the Catalyst application tree, and it made a program
that works fine.
That program works only if the application's modules from
the lib directory
are in place, otherwise, it doesn't work.

Do you know if it is possible to do what I want using
perlapp?

Thanks.

Octavian

_______________________________________________
PDK mailing list
PDKlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: Creating an executable
user name
2007-02-02 02:52:17
> I want to create an executable program that include all
the necessary
> modules in it, so it can run without needing other
files.

This is pretty much the point with perlapp, so you're in the
right place.

> The problem is that the program is made using Catalyst
framework and it
> doesn't work without the .pm modules.

Finding that the perlapp'ed executable won't run properly
due to missing 
modules is common and can have two major reasons.

It's likely that the Catalyst framework you use (I have no
idea what it is) 
load modules for use in a way that is non-obvious to
perlapp, i.e. basically 
it loads them dynamically as needed, for example by building
a string with 
the module name and then doing the equivalent of a 'use'
through eval and 
the variable name (many ways to go about this). The point is
that since the 
module name is computed at runtime, there's no way for
perlapp to figure out 
at compile time which modules needs to be put into the
executable. To combat 
this, you must figure this out and use '--add Some::Module'
to force 
inclusion of such modules. There are other techniques to
force the 
inclusion. Actually, some are built-in heuristics in perlapp
(e.g. when 
perlapp sees 'use Tk' it knows to bring in other things).

A more problematic situation is that some modules insist on
looking in the 
filesystem for modules to load. This can be fixed in a
similar way - you 
must use '--bind' incantations to include such modules so
they are 
automatically unpacked and made available at runtime in INC. Note
that this 
will put such modules in the clear on disk when your app is
run (while 
cleaned after use, they will still be there during the
run).

HTH,

ken1 

_______________________________________________
PDK mailing list
PDKlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: Creating an executable
user name
2007-02-02 04:30:47
Ok, thank you.

I will try adding --add to see if it works.

Yes, the modules are built dynamicly in Catalyst apps.
I have tried just specifying the "lib" directory
of the application when
running perlapp, but now I realise that if the modules are
built dynamicly,
they are not loaded anyway.

With --add it should work.

Octavian

----- Original Message ----- 
From: "Kenneth Ölwing" <kennetholwing.se>
To: "Octavian Rasnita" <orasnitagmail.com>; <pdklistserv.ActiveState.com>
Sent: Friday, February 02, 2007 10:52 AM
Subject: Re: Creating an executable


> > I want to create an executable program that
include all the necessary
> > modules in it, so it can run without needing other
files.
>
> This is pretty much the point with perlapp, so you're
in the right place.
>
> > The problem is that the program is made using
Catalyst framework and it
> > doesn't work without the .pm modules.
>
> Finding that the perlapp'ed executable won't run
properly due to missing
> modules is common and can have two major reasons.
>
> It's likely that the Catalyst framework you use (I have
no idea what it
is)
> load modules for use in a way that is non-obvious to
perlapp, i.e.
basically
> it loads them dynamically as needed, for example by
building a string with
> the module name and then doing the equivalent of a
'use' through eval and
> the variable name (many ways to go about this). The
point is that since
the
> module name is computed at runtime, there's no way for
perlapp to figure
out
> at compile time which modules needs to be put into the
executable. To
combat
> this, you must figure this out and use '--add
Some::Module' to force
> inclusion of such modules. There are other techniques
to force the
> inclusion. Actually, some are built-in heuristics in
perlapp (e.g. when
> perlapp sees 'use Tk' it knows to bring in other
things).
>
> A more problematic situation is that some modules
insist on looking in the
> filesystem for modules to load. This can be fixed in a
similar way - you
> must use '--bind' incantations to include such modules
so they are
> automatically unpacked and made available at runtime in
INC.
Note that
this
> will put such modules in the clear on disk when your
app is run (while
> cleaned after use, they will still be there during the
run).
>
> HTH,
>
> ken1
>

_______________________________________________
PDK mailing list
PDKlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: Creating an executable
country flaguser name
Singapore
2007-02-05 00:05:18
Octavian,

Do note that most Perl packagers give fair warning that
creating an 
executable does NOT mean that code is protected. Code is
'protected' 
from the casual browsers, but those who know about Perl will
have a good 
idea where to find the juice.

Octavian Rasnita wrote:
> Hi,
>
> I want to create an executable program that include all
the necessary
> modules in it, so it can run without needing other
files.
> I want to do this for protecting the source code.
>
> The problem is that the program is made using Catalyst
framework and it
> doesn't work without the .pm modules.
>
> I have tried creating an executable from the
script/myapp_server.pl program
> from the Catalyst application tree, and it made a
program that works fine.
> That program works only if the application's modules
from the lib directory
> are in place, otherwise, it doesn't work.
>
> Do you know if it is possible to do what I want using
perlapp?
>
> Thanks.
>
> Octavian
>
> _______________________________________________
> PDK mailing list
> PDKlistserv.ActiveState.com
> To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
>   

_______________________________________________
PDK mailing list
PDKlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: Creating an executable
country flaguser name
Singapore
2007-02-05 00:05:18
Octavian,

Do note that most Perl packagers give fair warning that
creating an 
executable does NOT mean that code is protected. Code is
'protected' 
from the casual browsers, but those who know about Perl will
have a good 
idea where to find the juice.

Octavian Rasnita wrote:
> Hi,
>
> I want to create an executable program that include all
the necessary
> modules in it, so it can run without needing other
files.
> I want to do this for protecting the source code.
>
> The problem is that the program is made using Catalyst
framework and it
> doesn't work without the .pm modules.
>
> I have tried creating an executable from the
script/myapp_server.pl program
> from the Catalyst application tree, and it made a
program that works fine.
> That program works only if the application's modules
from the lib directory
> are in place, otherwise, it doesn't work.
>
> Do you know if it is possible to do what I want using
perlapp?
>
> Thanks.
>
> Octavian
>
> _______________________________________________
> PDK mailing list
> PDKlistserv.ActiveState.com
> To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
>   

_______________________________________________
PDK mailing list
PDKlistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )