Are there any OCaml installers for Windows that can run in an environment without network access?
I don’t think so - IIRC fdopen’s “OCaml for Windows” installer still downloaded Cygwin every time and I don’t think DkML can be done entirely offline either. I’ve been musing restoring a graphical installer for OCaml (with opam 2.2, etc.) partly just “so that we have one”. Installing Cygwin without network access is cumbersome, but not impossible. What’s your usecase/audience?
I’m considering teaching a short online course using OCaml, and some of the students might be behind a firewall.
OCaml is among the Cygwin packages (in version 4.14.2).
You may download a minimal Cygwin set of package, then propose to install Cygwin from a local repository.
(Note, you may need ocaml and ocaml-dune)
Yeah, DkML does not support offline anymore (no one seemed interested at the time).
If you are fine with bytecode, you can use the mostly portable Windows zips from DkCoder. Example: https://gitlab.com/api/v4/projects/52918795/packages/generic/stdexport/2.1.4-r3/stdexport-windows_x86_64.zip with checksums and version numbers here and its license here.
Since I haven’t added an OCaml pass-through (yet) for DkCoder, I would suggest for your students:
- unzipping to a common place (
<drive>:\ocaml
) - edit the first two paths in
lib/findlib.conf
- make a wrapper
ocamlc.bat
andocamlrun.bat
that setsOCAMLLIB
,OCAMLFIND_CONF
,CAML_LD_LIBRARY_PATH
andPATH
(confer __dk.cmake lines 657-680)
The end result is you’ll have a lot of useful binaries (ocamllsp, dune, etc.) and many findlib packages available offline.
EDIT: You would also install the vcruntime DLLs from Latest supported Visual C++ Redistributable downloads | Microsoft Learn if they have brand new PCs. Visual Studio will not be needed.