2
votes

I desperately need your help! I need to compile a perl script to an executable so that it can be run in windows without having perl installed. I know it is not a good idea to do this , but I absolutely need it for the users of my script.

I have searched (a lot!) and decided the best solution is to use PAR::Packer. Yet I have been trying to install for something like 10 days now with no success… 

I ve tried all possible combinations of perl installation (activestate, strawberry, 5.10, 5.14, 5.16) and PAR versions, but I haven’t found the combination that really works….

I tried this link: http://www.nicholassolutions.com/tutorials/perl-PAR.htm

And this: http://www.rabbibob.com/index.php/PAR_Compiling_Perl_scripts_into_executables#Can.27t_find_par_loader

And various from this site..

Anyway, right now, I have installed (with the above instructions):

  • Strawberry perl 5.16.3001
  • PAR-1.007

The error I get now when I try to run

pp –o script.exe script.pl

is that:

pp is not recognized as an external or internal command, operable program or batch file

indeed I don’t find the relevant pp.bat in the bin. For earlier versions of par, this bat was created, although there other missing files were appearing when running pp….

My path variable contains:

C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin

I also used PAR::Packer 1.0.14 but I get errors in the installation, something like

dmake.EXE: Error code 255, while making 'subdirs'

So, my question is: does anyone know a sure way this can work?? I am really frustrated and really pressed, every help will be deeply appreciated.

Thanks a lot!

1
I think we need to see more of the last error message that you got with dmake. What else was printed along with that?stevenl

1 Answers

0
votes

I have used PAR to pack some scripts for other users. This has worked very well.

My old setup was done long ago. I have a new laptop and I tried to reproduce you error - but it seems like it just works.

My steps:

  • downloaded and installed strawberry-perl-5.18.1.1-64bit.msi
  • Install PAR::Packer with the cpan client
  • Create a testscript and type

    pp -c -o test.exe test.pl

the executable file pp is located in C:\strawberry\perl\site\bin\pp and was installed when i installed PAR::Packer.

If you cant find pp on you system you might want to check you installation of PAR::Packer.

I hope this helps :)