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". ;-)

In reply to Re^5: Installer for Perl Application by afoken
in thread Installer for Perl Application by wa4otj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.