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

Hello,

I am considering moving from ActiveState Perl v 5.10 && Cava Packager to Strawberry Perl v 5.18 && the PAR package from CPAN to deliver my windows executables.

My issue is that I don't have access to CPAN and cannot arrange for this access, so using CPAN tools to download and install is not an option for me. To date, all additonal PMs I ever needed were literally copy / pasted into a text editor, written to my Perl install, and renamed as needed.

I'd be grateful if anyone can point me in the direction of a step by step guide for getting CPAN PAR pp working in this situation, or else to an alternative tool chain that will do the same thing - and is being actively maintained.

I'm afraid commercial solutions are not open to me.

Apologies for any lack of familiarity with precise terms: I've not used CPAN PAR pp etc before.

Thanks in advance!

Replies are listed 'Best First'.
Re: Build EXE without CPAN access
by Corion (Patriarch) on May 31, 2016 at 10:56 UTC

    The algorithm is fairly simple:

    1. Gather all prerequisites of your top level module(s)
    2. While you have found new prerequisites in the last step, gather their prerequisites as well, and prepend them to the list
    3. For every distribution in the list of prerequisites, do the following steps:
      1. Create a directory named after the distribution and version number
      2. For every file in the current distribution:
        1. Download the file
        2. Save the file in the corresponding directory below the above directory
      3. Install the distribution:
      4. Open a command prompt in the distribution directory
      5. Read the files INSTALL and README
      6. Run the following command
        cpan .
        or alternatively
        cpanm . -L /the/directory/for/private/modules/
        or alternatively review local::lib.

    This is basically everything you need to do if you cannot simply download the tarballs of the distributions. This is also what the cpan tool does. If you can also download tarballs, maybe simply create a directory structure like CPAN has and put the tarballs there. You can create and use a local CPAN mirror. See also CPAN::Mini and Pinto.

Re: Build EXE without CPAN access
by Discipulus (Canon) on May 31, 2016 at 11:02 UTC
    ..even simpler as AnonymousMonks suggested: on another machine download a portable edition of strawberryperl then install everything you wont and then copy that distribution somewhere in the destination machine

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      Thanks all for the replies so far.

      The machine I am using is totally locked down. No USB access. No admin access - I have installed Perl to another location to avoid this. No possibility of downloading anything. No "fighting with admin privileges" - this will not even be attempted && whatever works for me will not attempt to bypass protection mechanisms and will work with the system as I find it. I was only able to install ActiveState Perl by jumping through several hoops - Strawberry Perl is a lot simpler in this respect.

      Thanks for the pointer about ppm.bat - I didn't know about that. I can't made ppm.bat run on my machine, but ppm-shell.bat does do something. Can I use this to make a windows exe?

      About the only things I can do are: 1. run something that is already included in a Perl distribution like Strawberry Perl; or 2. literally copy paste from source links on CPAN web pages into an editor and write them to my Perl install: no admin privileges required as I have installed elsewhere.

      Thanks again for the replies - just wondering what is possible.

        If you have a browser on the target machine, you can download the modules from CPAN and install the modules through the cpan tool from the distribution files directly, most likely with the cpan tool but certainly with the cpanm tool:

        cpanm ~/downloads/MyCompany-Enterprise-1.00.tar.gz # install from a +local file

        You can download and install cpanm via App::cpanminus.

        … I have installed Perl to another location …
        How did you do this and why can't you apply this to a minicpan?

        Another possibility might be Perl::Dist, specifically Perl::Dist::Strawberry seems to be actively maintained.

        Is this locked down machine a development system, or the same machine on which the script will later run? If the latter, why do you need to make an EXE at all?

Re: Build EXE without CPAN access
by salva (Canon) on May 31, 2016 at 10:35 UTC
    You would get better help if you give us a more accurate and detailed description of your environment and explain us why you can't save module source files if you can copy&paste them.
Re: Build EXE without CPAN access
by Anonymous Monk on May 31, 2016 at 10:22 UTC

    so using CPAN tools to download and install is not an option for me

    is usb an option?

Re: Build EXE without CPAN access
by $h4X4_|=73}{ (Monk) on May 31, 2016 at 10:58 UTC

    It sounds like your fighting with your administration privileges and your opening up your editor as admin.
    If your user has admin rights on the computer you can do it all, under admin.
    One way is to make a shortcut on your desktop to C:\Windows\System32\cmd.exe right click the short cut and Run as Administrator or go to properties to set it to always Run as Administrator. Installing from CPAN and on windows the firewall could stop you and perl could need access to the network, just a heads up.

    Update: Active State you want to update and install modules from CPAN with C:\Perl\bin\ppm.bat Nice and easy GUI. Just run as Administrator.

Re: Build EXE without CPAN access
by salva (Canon) on Jun 01, 2016 at 07:19 UTC
    Well, you can use Win32::GuiTest for automating copy&pasting into your editor.