in reply to Re: Installer for Perl Application
in thread Installer for Perl Application

As with the Perl2exe suggestion, this is the wrong direction. I WANT to put the Perl environment on the user's PC, so that I can lead them into the opportunity to tinker and learn. I just want to do so with minimum fuss and bother for that initial setup.

My hidden motive here is to seed the user base with Perl and working applications and encouragement to tinker, in the hopes that one day a few of them will grow into Perl enthusiasts. Just handing a working EXE to them, with all the "bones" carefully hidden away defeats the purpose. I want to give them the whole Perl Magic, and make it easily accessible to anyone who cares to look under the hood.

Thanks, Nat

Replies are listed 'Best First'.
Re^3: Installer for Perl Application
by Bloodnok (Vicar) on Jul 10, 2009 at 23:45 UTC
    In which case, why not try Strawberry perl - it's free, far simpler and what's more, far more flexible since it comes bundled with a C compiler and make.

    A user level that continues to overstate my experience :-))
      Thanks for the suggestion of Strawberry Perl. I am tinkering with it now, and I must say I am impressed. It seems like an excellent alternative to ActiveState.

      However, that still seems off-topic to my original quest, i.e. getting a newbie to Perl up and running with the Perl environment and a moderately complex Perl application with minimal fuss.

      Thanks to all for the help.

      Nat

        You could create a bundle from strawberry perl and your app, installing strawberry first, then your app, all from a single SETUP.EXE. Many installer generators seem to support such constructs, at least I saw such constructs several times when I reinstalled a Windoze machine recently.

        You could use a simple ZIP SFX, configured to unpack the strawberry installer and your app into a temp directory, then to run a batch file. In the batch file, check that C:\strawberry\perl\bin\perl.exe exists, otherwise run the strawberry setup. Then, install your application. If you don't like the pain of DOS batch files, interpret the batch file as perl code. Something like this (untested!):

        @echo off echo Searching Perl Interpreter ... if not exist c:\strawberry\perl\bin\perl.exe goto usesbp rem # no strawberry perl, perhaps ActiveState? if exist c:\perl\bin\perl.exe goto useap rem # nope, any other perl along the path? perl -e "print qq/Found Version $]\n/; exit 42" if errorlevel 43 goto noperl if errorlevel 42 goto haveperl :noperl echo No perl found, installing Strawberry Perl ... strawberry-perl-5.x.y.z.exe /command /line /parameters /for /silent /i +nstall :usesbp PATH=C:\strawberry\c\bin;c:\strawberry\perl\bin;%PATH% rem # ^-- PATH is not automatically updated after installation for THI +S batch rem # paranoia: do we really have a working perl? perl -e "exit 42" if errorlevel 43 goto brokensbp if errorlevel 42 goto haveperl :brokensbp echo Perl installation failed! goto die :useap PATH=C:\perl\bin;%PATH% rem # paranoia: do we really have a working perl? perl -e "exit 42" if errorlevel 43 goto brokenap if errorlevel 42 goto haveperl :brokenap echo Existing Perl installation is broken! goto die :haveperl perl -S -x %0 if not errorlevel 1 goto end echo Installer script died unexpectedly! goto die #!perl use 5.010_000; # or any earlier version your app runs with # line 40 # ^-- replace with number of THIS line or the line numbers will n +ot match the source use strict; use warnings; use FindBin; use Cwd; use Archive::Tar; use File::Path qw(mkpath); my $cwd=getcwd(); print "Installer invoked as $FindBin::Script (in directory $FindBin::Bin +),\n", "current directory is $cwd,\n", "Perl is $^X.\n"; my $tar="$FindBin::Bin/myapp.tar.gz"; my $dest="C:/foo/bar"; -f($tar) or die "Could not find myapp.tar.gz in $FindBin::Bin"; -s _ or die "myapp.tar.gz is empty! Died"; # Maybe test for required modules, install missing ones using the CPAN + classes, # perhaps from a compressed repository included in the installer. mkpath($dest); -d($dest) or die "Failed to create $dest"; chdir($dest) or die "Failed to chdir to $dest: $!"; Archive::Tar->extract_archive($tar,1) or die "Failed to unpack $tar: $ +Archive::Tar::error"; print "Finished installing the FooBar application\n"; exit 0; __END__ :die pause :end

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)