Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Bundling tools for perl GUI apps

by mattr (Curate)
on Jan 16, 2004 at 08:25 UTC ( [id://321757]=perlquestion: print w/replies, xml ) Need Help??

mattr has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I have a nagging question and seek your wisdom. I would like to distribute a perl-based application as a bundle, not for security but for easy installation. I'd like to be able to use perl to write apps that don't require the user to install anything else including perl.

There are two apps really, one is a standalone windows app using wxperl and sqlite, another one would run in a cywin environment using the cygwin dll and would launch a server.

I know there are installers and PAR is good, but what I'd really like is a way to put the various necessary files in one file and run from there.. like a virtual filesystem in a file. Ideally a set of nested folders including perl and compiled modules would be packed into a single exe.

I did find Thinstall which looks impressive but is quite pricey and I don't think I need a whole "virtual machine", just the virtual filesystem. I think Tcl's starkits do something a little bit like this. I also wonder if with Thinstall, if I was updating a sqlite table and the program was killed it could corrupt the binary but that isn't my worry right now. I haven't ever used perlcc or what ActiveState has, but would like to hear people who have used it.

Any ideas? I got to thinking about loopback filesystems but read that windows doesn't allow it (maybe that's old info). Maybe I should look at linux distros for windows that use the filesystem in a file, but I don't want to stop windows from running on the users' machines.

Thanks for your input.

Matt R.

Replies are listed 'Best First'.
Re: Bundling tools for perl GUI apps
by PodMaster (Abbot) on Jan 16, 2004 at 09:09 UTC
    That's what PAR does (a zip file is a virtual filesystem)...

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Bundling tools for perl GUI apps
by qq (Hermit) on Jan 16, 2004 at 13:09 UTC

    PAR is very nicely described on the advent calendar: PAR.

    qq

Re: Bundling tools for perl GUI apps
by mattr (Curate) on Jan 16, 2004 at 17:31 UTC
    Thank you very, very much. PAR looks like it will do exactly what I want for the wxperl + sqlite app I mentioned. I had a pretty superficial and dated understanding of what PAR can do and have been surfing resources to learn more about it. Thank you again.

    It looks like a bit of experimentation is in order. Maybe you have answers to these questions? (I've now read the PAR pods, A. Tangs' slides, and the faq).

    1. For a wxperl + sqlite app, I guess it will be safest to use just Activestate Perl.
    2. Can I however do it in cygwin using cygwin perl, and run perl in cygwin environment inside the PAR archive?
    3. Will PAR pull in cygwin1.dll so I can still launch as a single EXE?
    4. For the second app, which is cygwin apache and CGI or better mod_perl, I wanted to know if par would happily pack httpd and httpd.conf, and let me launch a web server as a forked process from within perl, and let me run a mod_perl server inside this EXE. I see from Tang slide 17b that somehow with PAR and Apache::PAR this actually works!! Is this the best kept secret of perldom? Actually that and the next few slides are amazing. I also understand now that with PAR we can do on demand libraries and product activation too.
    4b. Though after all 40 slides I don't see how we have an actual virtual filesystem that other programs will believe. Trust in magic.. I want to see the output from "ls" though, I'm not quite convinced yet that will work. But then again I don't need to run that yet, and could maybe make a module to do run such an external program if there was a problem.
    4c. Now wondering if I can then just run the server from a bourne shell script then.. actually the mechanism for launching the server and so on is not immediately clear from the slides and Apache::PAR tutorial but I'll work on it.
    5. I notice the multiarch switch. Too much to ask for me to be able to develop it all in linux and deployed in windows?

    Thanks again for your help!

    Matt R.

      Answering #1,2,3

      You really should use the ActiveState distribution to prevent many headaches. The environments that cygwin and activestate run in are vastly different.

      ActiveState PAR
      Windows->Perl

      Cygwin PAR
      Windows->Cygwin->Perl

      It's the perl part and what it needs to interact with it's environment that gets boxed up. In Cygwin's case cygwin is the environment so you'd only be able to make a self hosting archive (".exe")that runs in cygwin.

      As for the rest of your questions why haven't you installed it and tested? That's all the fun.

      --
      Clayton
      4b. Though after all 40 slides I don't see how we have an actual virtual filesystem that other programs will believe. Trust in magic.. I want to see the output from "ls" though, I'm not quite convinced yet that will work. But then again I don't need to run that yet, and could maybe make a module to do run such an external program if there was a problem.
      Like I already said, a zip-file is a filesystem. I don't know of any "ls" program that deals with zipfiles, but then you wouldn't want to use "ls" to manipulate zip files. See Accessing packed files in PAR::Tutorial
      5. I notice the multiarch switch. Too much to ask for me to be able to develop it all in linux and deployed in windows?
      I develop stuff on windows and deploy it on linux (and vice versa) all the time :-) All the multiarch switch does it sets up all the modules in the archive in an architecture/platform specific directory( like foo.par\MSWin32-x86-multi-thread\), so you can have a single par archive usable on many platforms (i don't see the appeal, it just bloats size).

      You still need to build a binary for each of your target platforms(par doesn't support that yet).

      PAR also doesn't support creating such a multiarch .par (par cannot leverage ppm...).

      What I just described is sort of a wishlist item (I recall it being discussed somewhere, and I believe its somewhere on the TODO but it's a long ways off).

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Bundling tools for perl GUI apps
by Anonymous Monk on Jan 17, 2004 at 04:11 UTC
    Hi Matt,

    I'm the author of Thinstall, and I can swing you a free copy of Thinstall if you made a nice demo and associated tutorial showing how it could be used to package perl programs into a single EXE. I don't think many people know of the potentional to do this, or how to do it, but we haven't had time to make a nice demo and there aren't any perl experts yet - so such a demo would be great. The tutorial should be in HTML with step by step instructions, screen shots, graphics, etc... so that someone unfamaliar with Thinstall could quickly do the same thing. The resulting EXE should run from CDROM/download link without any installation and on restricted guest account for Windows XP.

    If interested, contact me at jclark-at-thinstall.com. I'm out of town until Tues...

    Jonathan

    P.S. To answer your question about updates, file updates are always stored outside the EXE so the EXE can never be corrupted in this fashion.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://321757]
Approved by Corion
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-19 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found