[ANN] DkML Install API 0.4.0

I’m pleased to announce that DkML Install API 0.4.0 is available on opam. This library is what I’ve been using to create the DkML Windows distribution installer.

TLDR: To create your own installer for your own software, you define “components” which have dependencies on other components. A component is an OCaml module you create with four essential functions: admin_install and admin_uninstall for escalated privileges, and user_install and user_uninstall for normal user privileges. Each component almost always needs to access assets which can be defined in the install:[] section of an .opam file. The net effect is you can use opam and OCaml to define your own reproducible installer.

There is a walk-through at https://diskuv.github.io/dkml-install-api/doc/packages/Console.html and more general documentation at https://github.com/diskuv/dkml-install-api#readme

The library works well for the DkML Windows distribution, although it is too complicated to recommend for casual use today. Regardless, if someone has a burning desire to create their own installer, and that installer has reasonably complex logic that needs to run on the end-user machine, then take a look at DkML Install API! Expect to see a steady but slow series of changes to the API until it hits 1.0.0.

Limitations: Today it can make an end-to-end installer for Windows. I haven’t needed yet to create macOS and Linux installers, although 95% of the pieces are present. If you are interested in creating the final packaging step for those OS-es (ex. a .deb apt packager for Debian), feel free to contribute a PR!

2 Likes

DkML Install API 0.5.1

This was newly released today. It has some backwards-incompatible changes which necessitated bumping to 0.5.x:

  • Only register desired components. Previously all the components in the ocamlfind universe (ex. opam switch) were registered. Now only chosen components and their dependencies are registered.
  • Add install/uninstall dependencies to META of each component opam package. For now this is duplicative with Component Registry, but gives access component graph purely with ocamlfind so can be used at code generation time.

And there is one bugfix:

  • Print both error message and backtrace, not just backtrace.

DkML Install API 0.5.1 was the version used to create the DkML 2.0.3 Windows installer thanks to the financial support of the OCaml Software Foundation.