Re: How to make EXE file for Windows cmd window
by afoken (Chancellor) on Dec 23, 2015 at 12:18 UTC
|
Can I make a windows CLI exe file on Ubuntu perl?
In the way that you want? No.
Of course, you could write out bytes that represent a windows executable, from almost any version of perl running on almost any operating system.
But wrapping a perl script, its requirements, and a perl interpreter into a Windows executable will most likely work only on Windows (simply because you neither have a windows based Perl interpreter on Ubuntu, nor you have the required compiler to compile XS modules for Windows). And even there, it's a bad idea. Better bundle perl (e.g. Strawberry) and your script and install that using an installer package like InnoSetup.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] |
|
But wrapping a perl script, its requirements, and a perl interpreter into a Windows executable will most likely work only on Windows
I don't care on what OS the EXE is made on, I just need to make an EXE that works on Windows only. My problem, is so far, no Perl for Windows can make an EXE for me yet, for various reasons explained above.
| [reply] |
Re: How to make EXE file for Windows cmd window
by Lotus1 (Vicar) on Dec 23, 2015 at 16:20 UTC
|
•pp and PAR::Packer cannot be installed on Strawberry Perl 5.18.2. It just doesn't work. I tried with cpanm, cpan, and ppm. It fails on all accounts.
What errors do you see when you tried with cpan?
•The default Par::Packer from cpan that is gotten is 1.27, though the most recent version on CPAN says, as of yesterday, 1.28. I don't know why.
I downloaded the 1.28 version of PAR::Packer just now and transferred it to a server that is not web connected and installed it using dmake. It works. It's on Windows Server 2008 with Strawberry Perl 5.16.2 64 bit. I had to upgrade PAR to 1.010, 5.16.2 comes with a slightly older version. There were only a couple of other modules that I had to install. Getopt::ArgvFile and Module::ScanDeps. I already had Test::Requires.
•pp doesn't seem to install with most versions of Strawberry perl. PP has been broken for years with SP.
My workstation runs Windows 7 and has Strawberry Perl 5.18.2 installed. I just tested pp and it works. To see which version I have and what is available I opened the interactive cpan client from the command line and then did the following.
cpan> i PAR
Module id = PAR
CPAN_USERID RSCHUPP (Roderich Schupp <rschupp@cpan.org>)
CPAN_VERSION 1.010
CPAN_FILE R/RS/RSCHUPP/PAR-1.010.tar.gz
UPLOAD_DATE 2015-07-13
MANPAGE PAR - Perl Archive Toolkit
INST_FILE C:\strawberry\perl\vendor\lib\PAR.pm
INST_VERSION 1.007
cpan> i PAR::Packer
Module id = PAR::Packer
CPAN_USERID RSCHUPP (Roderich Schupp <rschupp@cpan.org>)
CPAN_VERSION 1.027
CPAN_FILE R/RS/RSCHUPP/PAR-Packer-1.028.tar.gz
UPLOAD_DATE 2015-11-19
MANPAGE PAR::Packer - PAR Packager
INST_FILE C:\strawberry\perl\vendor\lib\PAR\Packer.pm
INST_VERSION 1.025
The file version above shows 28 but CPAN thinks it is 27. I just did an "install PAR::Packer" and it worked. INST_VERSION is now 1.028. I just ran pp and created an exe that runs.
If you don't want to try a fresh install of Strawberry Perl you might try the portable version. You can install that to its own folder on your hard drive and then run cpan from its command line.
| [reply] [d/l] |
Re: How to make EXE file for Windows cmd window
by james28909 (Deacon) on Dec 23, 2015 at 13:33 UTC
|
You should check out the Perl Dev Kit. I have the latest PDK and it works lovely. You can also script GUI's and pack them with PDK as well. I have a multi-tool going and its all scripted in perl and packed with PDK.
EDIT: Also I should add that I am running Active State Perl version 5.16.3 and the latest PDK. Ive also noticed alot of modules are not readily available for the newer versions of AS Perl, which is why I stay on 5.16.3.
EDIT 2: Also, even with AS Perl, I install many modules from CPAN. and also with AS PPM you can add more repos as well.
| [reply] |
|
| [reply] |
|
| [reply] |
|
Geez, I can't afford $300 for PDK.
| [reply] |
|
Or you can send me the script and I can pack it into an exe for you
| [reply] |
|
I also sent you some more info via /msg
| [reply] |
Re: How to make EXE file for Windows cmd window
by soonix (Chancellor) on Dec 23, 2015 at 19:25 UTC
|
| [reply] [d/l] |
|
perl -V:myuname && which pp.bat
myuname='Win32 strawberryperl 5.14.2.1-portable #1 Tue Nov 22 18:24:29
+ 2011 i386';
C:\path\strawberry\perl\bin\pp.bat
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.
| [reply] [d/l] |
Re: How to make EXE file for Windows cmd window
by dbuckhal (Chaplain) on Dec 24, 2015 at 03:21 UTC
|
Assuming you have a Windows platform available, I've been successful with just downloading a version of Strawberry Perl Portable to compile exe's using PAR::Packer. Just unzip to a directory, double-click on the portableshell batch file, install your needed modules in that CPAN, and see if that works for you.
Hope it helps!
| [reply] |
Re: How to make EXE file for Windows cmd window
by Anonymous Monk on Dec 23, 2015 at 23:31 UTC
|
| [reply] |