How do I make a standalone WIN32 executable from Perl?

J

Jeff W

Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
could write PC scripts and utilities. I downloaded ActivePerl and
looked at it. However, it appears that I would need a perl
installation on every target machine. Is there any easy, (and low or
zero cost) way to generate standalone Perl/Tk executables?

Thanks
/j
 
T

Tom

Jeff W said:
Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
could write PC scripts and utilities. I downloaded ActivePerl and
looked at it. However, it appears that I would need a perl
installation on every target machine. Is there any easy, (and low or
zero cost) way to generate standalone Perl/Tk executables?

I would look at embedding the Perl in C/C++ and compiling it that way.
That way, all you need is a very basic C/C++ program.
 
B

Bob Walton

Jeff said:
Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
could write PC scripts and utilities. I downloaded ActivePerl and
looked at it. However, it appears that I would need a perl
installation on every target machine. Is there any easy, (and low or
zero cost) way to generate standalone Perl/Tk executables? ....
/j

I don't understand why you think you need to make an executable to have
it run anywhere that uses the same platform. It is easy, for example,
to make a CDROM that will autorun a Perl/Tk program on any target Win32
system, without installing anything, making any executable, etc. Here
is an example directory list of such a CDROM:

E:\>dir

Volume in drive E is 000716_2242
Volume Serial Number is 3DD9-9056
Directory of E:\

AUTORUN INF 30 07-16-00 4:08p autorun.inf
LOOKUP BAT 26 07-16-00 4:03p lookup.bat
LOOKUP PL 4,118 07-16-00 9:38p lookup.pl
LPAP DBN 499,712 07-15-00 11:20p lpap.dbn
LPFN DB 5,218,304 07-15-00 10:49p lpfn.db
LPHN DBN 4,472,832 07-15-00 11:13p lphn.dbn
LPLN DB 5,767,168 07-15-00 10:49p lpln.db
LPMAIN DB 84,811,776 07-15-00 10:49p lpmain.db
LPMI DBN 2,449,408 07-16-00 12:56p lpmi.dbn
LPSD DBN 155,648 07-15-00 11:13p lpsd.dbn
LPSF DBN 147,456 07-15-00 11:04p lpsf.dbn
LPSM DBN 2,809,856 07-15-00 11:13p lpsm.dbn
LPST DB 5,873,664 07-15-00 10:49p lpst.db
LPTN DBN 2,875,392 07-16-00 8:41p lptn.dbn
LPZP DBN 2,924,544 07-15-00 11:21p lpzp.dbn
PERL <DIR> 07-16-00 10:42p Perl
README TXT 10,719 07-16-00 10:37p readme.txt
SETUP BAT 26 07-16-00 4:03p setup.bat
17 file(s) 118,020,679 bytes
1 dir(s) 0 bytes free

E:\>

The Perl/Tk program is lookup.pl, the Perl directory is a direct copy of
my Perl directory on my PC, including everything there (if space were an
issue, one could get rid of the docs, unused modules, etc). The
autorun.inf file contains:

[autorun]
open=lookup.bat

and lookup.bat contains:

@perl\bin\perl lookup.pl


The rest of the files are data files or informational. Setup.bat is
just a copy of lookup.bat for those who might have autorun turned off --
folks are more likely to type "setup" than "lookup".

Folks can also simply copy the whole CD to a directory on their hard
drive, and have it work from there with better performance than straight
off the CD, with no setup, installation, etc -- and have it be 100% gone
when they erase the directory. All in all, very effective and very easy.

HTH.
 
J

James Willmore

Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but
i AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32
so I could write PC scripts and utilities. I downloaded ActivePerl
and looked at it. However, it appears that I would need a perl
installation on every target machine. Is there any easy, (and low
or zero cost) way to generate standalone Perl/Tk executables?

In the land of *NIX, you could use perlcc to compile an application.
In Windows land, you _may_ have to get a comercial application -or-
use Cygwin, compile Perl, and then you _should_ have perlcc available
to you.

I can't speak from experience, but that's my understanding.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
An artist should be fit for the best society and keep out of it.
 
J

Jeff W

I appreciate the idea, but I don't really want to leave 118M on
someone's system because i gave them a 50KB utility...
thanks though
/j

Bob said:
Jeff said:
Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me, but i
AM a UNIX perl hacker, I was thinking of learning Perl/TK on WIN32 so I
could write PC scripts and utilities. I downloaded ActivePerl and
looked at it. However, it appears that I would need a perl
installation on every target machine. Is there any easy, (and low or
zero cost) way to generate standalone Perl/Tk executables? ...
/j

I don't understand why you think you need to make an executable to have
it run anywhere that uses the same platform. It is easy, for example,
to make a CDROM that will autorun a Perl/Tk program on any target Win32
system, without installing anything, making any executable, etc. Here
is an example directory list of such a CDROM:

E:\>dir

Volume in drive E is 000716_2242
Volume Serial Number is 3DD9-9056
Directory of E:\

AUTORUN INF 30 07-16-00 4:08p autorun.inf
LOOKUP BAT 26 07-16-00 4:03p lookup.bat
LOOKUP PL 4,118 07-16-00 9:38p lookup.pl
LPAP DBN 499,712 07-15-00 11:20p lpap.dbn
LPFN DB 5,218,304 07-15-00 10:49p lpfn.db
LPHN DBN 4,472,832 07-15-00 11:13p lphn.dbn
LPLN DB 5,767,168 07-15-00 10:49p lpln.db
LPMAIN DB 84,811,776 07-15-00 10:49p lpmain.db
LPMI DBN 2,449,408 07-16-00 12:56p lpmi.dbn
LPSD DBN 155,648 07-15-00 11:13p lpsd.dbn
LPSF DBN 147,456 07-15-00 11:04p lpsf.dbn
LPSM DBN 2,809,856 07-15-00 11:13p lpsm.dbn
LPST DB 5,873,664 07-15-00 10:49p lpst.db
LPTN DBN 2,875,392 07-16-00 8:41p lptn.dbn
LPZP DBN 2,924,544 07-15-00 11:21p lpzp.dbn
PERL <DIR> 07-16-00 10:42p Perl
README TXT 10,719 07-16-00 10:37p readme.txt
SETUP BAT 26 07-16-00 4:03p setup.bat
17 file(s) 118,020,679 bytes
1 dir(s) 0 bytes free

E:\>

The Perl/Tk program is lookup.pl, the Perl directory is a direct copy of
my Perl directory on my PC, including everything there (if space were an
issue, one could get rid of the docs, unused modules, etc). The
autorun.inf file contains:

[autorun]
open=lookup.bat

and lookup.bat contains:

@perl\bin\perl lookup.pl


The rest of the files are data files or informational. Setup.bat is
just a copy of lookup.bat for those who might have autorun turned off --
folks are more likely to type "setup" than "lookup".

Folks can also simply copy the whole CD to a directory on their hard
drive, and have it work from there with better performance than straight
off the CD, with no setup, installation, etc -- and have it be 100% gone
when they erase the directory. All in all, very effective and very easy.

HTH.
 
J

Jeff W

thanks James - I think you are saying I should run unix perl under
cygwin and use the perlcc provided with that perl. Will that really
give me a WIN executable?
/j
 
J

Jeff W

Thanks Tina - I had found that and tried to read through it - it didn't
seem easy to use by itself - also - I couldn't find a mention of it in
ActivePerl - which I thought would be necessary under win32

/j
 
A

astewart1

Thanks Tina - I had found that and tried to read through it - it didn't
seem easy to use by itself - also - I couldn't find a mention of it in
ActivePerl - which I thought would be necessary under win32

/j

PAR is very easy to use. The "pp" command scans all the files needed
for your application, zips them up together and turns that into a
standalone executable. If the PAR documentation looks confusing,
concentrate on the description of pp.

You need the Perl installation to create packages, but the target
machines do not. PAR is not mentioned in ActivePerl because it is not
part of it. You can download PAR from CPAN, and even if ActiveState
has a version on its PPM server, it is probably out of date. PAR is
improving rapidly.

And it's free....

Alan Stewart
 
J

James Willmore

On Sun, 19 Oct 2003 19:41:55 -0400

Top posting for this group is rude - please don't do it :)
thanks James - I think you are saying I should run unix perl under
cygwin and use the perlcc provided with that perl. Will that really
give me a WIN executable?
/j

It _should_. Like I mentioned in the previous post, I haven't done it
:-(

Worse case is you have to put out $$$ for a commercial product - like
perl2exe. However, if you're like me, you'll try the free route
first.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Dear Lord: I just want *one* one-armed manager so I never have
<to hear "On the other hand", again.
 
C

Cyde Weys

Jeff said:
thanks!!!! - And from someone with the same name as my favorite
Folk/Rock Artist 8-}

Can you please stop top-posting ... please ... think of the kittens.
 
K

Kåre Olai Lindbach

thanks James - I think you are saying I should run unix perl under
cygwin and use the perlcc provided with that perl. Will that really
give me a WIN executable?

I will, but you need to include the cygwin1.dll, and maybe other
dll-s, depending on how advanced your perlskript is, if you want to
run it in another MSwin-environment without Cygwin installed.
 
J

Jeff W

I[t] will, but you need to include the cygwin1.dll, and maybe other
dll-s, depending on how advanced your perlskript is, if you want to
run it in another MSwin-environment without Cygwin installed.

Ok - so I'm back at square one - you're saying I'm just trading the
requirement that the target machine has Perl for the requirement that it
has Cygwin. Ok. It was worth asking. But, time to learn Visual C++
(sigh) 8-}

Thanks all
/j [no longer a top poster]
 
J

Jeff W

Cyde said:
Can you please stop top-posting ... please ... think of the kittens.

Got it - I'm new to this group - and I have to admit - as good as you
guys are at answering my questions (and you are, really!). You're twice
as good about telling me to bottom post. {aren't you supposed to read
prior posts first to see whether I've already been told 8-}]

sorry - don't mean to pick on you but this about the 5th admonishment
I've received today 8-{
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top