How can I install package in ActivePerl without Internet connection? - windows

In ActivePerl, "ppm" installs a package from the Internet, "ppm install x.ppd" installs from a ppd file, but most CPAN packages are distributed as .tar.gz
How do you supply modules to a machine running ActivePerl that doesn't have an Internet connection? ("make" will probably not be available.)
Update: an Internet connection can be used to download files and transfer them to the machine with a USB key, etc.

I am sure there is an easier way, but I just checked a ppd file and it is just an xml file ...
So you should be able to do the following if you want to install manually on a pc with no connection:
Open the file , ex
http://trouchelle.com/ppm/Acme-LOLCAT.ppd
and download the appropriate file pointed to in the CODEBASE tag, in this case:
http://trouchelle.com/ppm/MSWin32-x86-multi-thread-5.8/Acme-LOLCAT-0.0.4.zip
Put both file on the pc with no connection, CODEBASE HREF="xxx" should be pointing to the zip file (either by putting the file in the same relative subfolder or by fixing the href so it points to the zip file on your disk)
Install from the ppd using
ppm install x.ppd

See: http://docs.activestate.com/activeperl/5.10/faq/ActivePerl-faq2.html#zip_files

I know it's not an answer to your question, but if possible consider using Strawberry Perl, a CPAN-friendly distribution of Perl for Windows. It has a tidy installer, ships with make, a compiler and a properly configured CPAN shell all ready to go.
And then you can use something like minicpan to create an offline CPAN repository.
Don't be a second class Perl citizen and have to wait for someone else to compile you a ppm, drink straight from the CPAN firehose!

Since this is a very frequent scenario, I complete the answers here :
As far as ActivePerl 5.14 is concerned you can also download ".tar.gz" files for your platform, or download so-called ".ppmx" files (same format). Save the files and invoke the ppm installer later when offline :
ppm.bat install MIME-Lite-3.028.ppmx

You might be interested in A guide to installing modules for Win32. It's a bit outdated (it talks about the command-line ppm) but the principles remain the same.

Related

How to how to install poppler from the .tar file downloaded from poppler official site

There is no useful information on the site describing how to install the file .I have tried extracting the .tar file, installing through command prompt . there is no information available on the web.OS used is windows 11. Its for a project to extract data from images, using OCR. Poppler is used for getting page numbers of the pdf file which will be converted to an image file later in the process."https://poppler.freedesktop.org/" is the site from which I downloaded the file.Is this the right site.Any answer is helpful.Thank you
Poppler source is constantly updated, and thus common for Linux and Mac users to build or brew on demand. It is not much different when using Programming Suites like Python, Ruby etc.
Windows users expect one exe, but the poppler utils were built as a spin off from non-commercial licensed xpdf and for personal 32 bit users that is often simpler.
I have given examples for how simple that xpdf unpacking can be for one exe in several posts such as https://stackoverflow.com/a/68697144/10802527 (how to scan a file list, not used here) and https://stackoverflow.com/a/73123537/10802527 (how to use to run a single file) and
https://stackoverflow.com/a/73437398/10802527 (running one exe on demand)
Poppler prebuilt binaries are available as 64bit only so the first step after making a work directory is download latest version from https://github.com/oschwartz10612/poppler-windows using most current
https://github.com/oschwartz10612/poppler-windows/releases/download/v22.04.0-0/Release-22.04.0-0.zip and save to the working folder, then you can use right click Extract All... OR
tar -m -xf Release-22.04.0-0.zip to unpack in that folder so it should look like in the binary folder
Now the exe files are in a subdirectory and when using those it is best if that folder is included on the path environment.
RESIST any means to add using set or worse setx simply add folder via system gui, note in some cases after saving the setting it may need log off and log on to stick and in very rare cases even a reboot/restart.

Copy python modules from one system to another

Is it possibe to copy all of the python modules from one Windows computer to another computer? They are both running the same version of Python 2.7.12.
The reason for doing so is that I have internet access on one of them, and manual installing modules on the other requires to much time because of dependencies.
I suppose you mean "copy the python installation from one system to another" (else the answer is: put your modules on a USB key and copy them to the other system).
the best way
The best way of course would be to install Python properly on the other system using setup. But as you said, all dependencies/external libraries that you could easily get using pip for instance would have to be re-done. Nothing impossible with a small batch script, even if you don't have internet, but you would have to get hold of all the .whl files.
the full treatment, portable-style
But if you cannot you can create a "portable" version of python like this:
zip the contents of C:\python27 to an USB key
copy all python DLLS: copy C:\windows\system32\py*DLL K: (if K is your usb drive)
unzip the contents of the archive somewhere on the second machine
add the DLLs directly in the python27 directory.
(those DLLs were installed in the windows system in previous Python versions, now it's even simpler since they are natively installed in the python directory)
The advantage of this method is that it can be automated to be performed on several machines.
There are some disadvantages too:
python is not seen as "installed" in the registry, so no "uninstall" is proposed. It's a portable install
associations with .py and .pyw are not done. But you can do it manually by altering some registry keys.
another method, better
You can have best of both worlds like this:
perform a basic install of python on the second machine
overwrite the install with the zip file
=> you get the registered install + the associations + the PATH... I would recommend that last method.
Last partial method, maybe best matching your question
Try copying the Lib directory only. It's where the libraries are installed. I'm not 100% sure but it worked for me when I wanted to put wx on a python install lacking wx.
Of course you will copy over already existing files, but they are the same so no problem. I let other people comment if this is acceptable or not. I'm not sure of all the installation mechanism, maybe that will fail in some particular case.
In my case, copy-pasting python installation didn't do the job.
You need to check the "C:\Users\\AppData\Roaming\Python*" folder. You may find installed python modules there. Copy and paste these into your source folder will add these modules to your python.

Running or modifying the source code(binaries) that are available under GNU General public license

Dear stackoverflow members,
I have a question that might sound silly to most of the members here, but it is bothering me for quite a while now and couldn't find any appropriate answer for it, yet.
My question is, how can we run a source code or binary of a open source project which is distributed under GNU license.
When I download the project, all I get is a .tar file, when unzipped, I get a folder containing many sub-folders, like src, build and etc. This folder looks similar to the project folder created by an IDE like netbeans. But how can I compile and modify these source file?
Is there an application that does it? or do i have to switch to linux to do it?
I am currently using a copy of windows 7 and also have a copy of windows xp at disposal.
Any help would be very much appreciated.
Thank you very much in advance.
cheers
Kishore.
Under GNU and GNU/Linux distros the packages are installed by the package manager (e.g. no need to build or download anything). Some programmers distribuite (along with the source code) binary versions of the program (which you run by clicking on them, or by invoking them from the command line). You can compile source code on Windows thanks to MinGW. For the istructions to run read the `README' file that you find in the unpacked dir. Most programs can be build with:
./configure; make; make install
If you post the link to the project I could help you with the building process.

How do you build perl source code to target Windows?

I've got some perl source code here, how do I build it on Windows, to get a windows binary that I can work with?
Usage of external tools normally comes with compatibility issues, random errors etc. You are better off using the inbuilt perl 'pp' tool. Install PAR::Packer (which includes the pp tool) module and then read the manual for it...
It allows you to pack your perl scripts to executables, and has options as what modules and dependencies to include, I've used it on winXP and win7 and never had an issue with any executabe produced.
pp manual
I've found Cava Packager to be just what I needed.
(source: cavapackager.com)
How to compile Perl scripts into EXEs
Download ActivePerl 5.10 for Windows.
Install it.
Restart your PC.
Download Cava Packager
Install it.
Open it.
Make a new project choosing a blank folder.
Scripts > Add..
Choose your .PL script file
Perl library > [...]
Choose "C:\Perl\bin\perl510.dll"
Add
Choose "C:\Perl\lib\"
Save
Build
You could use the Perl Development Kit from ActiveState to "compile" your script to a .exe file. I used it to create binaries of MRTG and a couple tools more to be deployed on windows servers running as a service. There used to be another product (from IndigoStar or something) called perl2exe I think to get the same result.
Just a note that Cava Packager also supports creating executables from Perl code on Linux and Mac OS X in addition to the original Windows version.
Note: As indicated by my name, I am affiliated with Cava Packager.

How do I manually install an old cygwin package?

A project I am working on requires an old version of SLAPD (the LDAP
server) and must run on Windows, hence I am using cygwin packages:
I've found a binary package of slapd version I need 2.2.x here:
http://www.mirrorservice.org/sites/sourceware.org/pub/cygwin/release/...
How do I manually install it in cygwin? It does not seem to be a package-manager file format (like an RPM or a Deb), but is there a tool to install it for me?
FYI, I'm operating behind a corporate firewall that prevents me from viewing the main cygwin site (including the documentation), so please nobody tell me to RTFM - I wish I could!
Thanks
If you need an older version, the Cygwin time machine might help. To use it, I had to invoke setup.exe from the command line, giving it the --no-verify/-X option and it still wouldn't let me downgrade the "cygwin" package itself but at least it is, albeit very slowly, allowing me to install the version I wanted to test as a parallel installation.
If you are using the cygwin package installer to install this package, usually if you select to view the full info and scroll to the package you need you will see some info about the version.
Now if you click on the version number you will see that it changes from the oldest in the repository to the current. If your repository has the version you need then just finish the wizard.
Some cygwin mirrors keep old package files, for example, http://mirror.isoc.org.il/pub/cygwin/
You can use Sonatype nexus to mirror an existing cygwin repository, but provide your own setup.ini .
Copy the already downloaded repo content to c:\progs\nexus\sonatype-work\nexus\storage\mirror.isoc.org.il-pub-cygwin\
Put your own setup.ini and setup.bz2 there.
Start setup.exe with --no-verify
Paste
http://localhost:8081/nexus/content/repositories/mirror.isoc.org.il-pub-cygwin/
into the mirror selection box and click "Add"

Resources