Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install pp (PAR Packager)?

I have to create an exe from a Perl script. I installed

ActivePerl-5.14.2.1402-MSWin32-x86-295342.msi

How do I install pp?

like image 396
Андрей Миланов Avatar asked Nov 08 '11 18:11

Андрей Миланов


3 Answers

I know this is a relatively old question, but for the sake of others, here is a solution that worked for me using pp (Par Packager):

  1. Install Strawberry Perl for windows (I installed strawberry-perl-5.16.3.1-64bit.msi)
    • I used 5.16.3.1 because I wanted to try out perl2exe as well, while I'm at it (perl2exe at the time supported only up to 5.16.3 version of perl)
  2. Once installed, open Strawberry Perl Tools (e.g. through start menu -> All programs -> Strawberry Perl -> Tools), and invoke CPAN Client
  3. In the client console that opens, type:
    • get pp
    • install pp
  4. Once installation is complete, you can simply run:
    • c:\strawberry\perl\site\bin\pp.bat -o myScript.exe myScript.pl
    • Which will produce a myScript.exe which is a standalone executable (no external perl interpreter is needed)

Note: You can use the -d command line switch in order to reduce the size of the executable. This will not include perl interpreter code inside the executable, reducing the size of the executable, however you will need to provide perl5x.dll in the same directory as your executable, or include it on the PATH environment variable.

like image 102
lev haikin Avatar answered Oct 06 '22 01:10

lev haikin


Until the issue with 1.010 is fixed, do the following:

  1. Go to http://search.cpan.org/dist/PAR-Packer/

  2. From the "Other releases" drop down list, select PAR-Packer-1.009 and download it

  3. Decompress the archive, preserving directory structure

  4. Run perl Makefile.PL

  5. Install all the missing prerequisites by hand using ppm. E.g., ppm install Module::ScanDeps etc

  6. Install MingW: ppm install MingW

  7. dmake, then dmake test, then dmake install

Later, you can remove PAR::Packer from the site area using the ppm GUI and install the fixed version.

like image 28
Sinan Ünür Avatar answered Oct 06 '22 00:10

Sinan Ünür


This is a Perl module called PAR::Packer, so it can be installed as any Perl module with CPAN. Unfortunately, you're using ActivePerl which isn't quite compatible with CPAN. Instead, you can see if use ActiveState's Perl Package Manager to install this module.

If the module isn't available via the Perl Package Manger, you can try installing with the CPAN command line utility. Open up a Console Window (Start->Accessories->Command Prompt) and type in cpan and press <ENTER>. Newer versions of ActiveState should automatically install the required compilers, etc. when you first start to use CPAN.

I prefer Strawberry Perl for Windows because it's more compatible with CPAN. However, ActivePerl has a lot of the Win32 modules already installed. Plus, it comes with the Perl Package Manager which is nice.

WARNING: ActiveState installs a lot of these Perl scripts not in C:\Perl\bin, but in C:\Perl\Site\bin which means you have to make sure that directory is in your path too.

like image 20
David W. Avatar answered Oct 06 '22 00:10

David W.