When installing a small test release on a clean Windows 10 machine, I just discovered that “Visual C++ 2013 and Visual C++ Redistributable Package” is not present by default, and erl.exe is dependent on the file msvcp120.dll (at least) from that package.
I really like the release thinking to get everything into one directory and just zip-it and ship-it, but this dependency kind of breaks that.
I tried to just copy the dll files into the erts-xx.x\bin directory and then it seems to work (at least I do not see any complaint that file is missing). But it would be really nice if mix release could fix this, or give me a hint or some recommended way to handle this…
I was also a bit surprised that erlang does not install this file in its own directory, but rather depends on the file existing in windows\system32 directory…
For note, the VC++ redistributable’s should never be installed in a program directory, they are designed for exclusive system-wide access (and they usually come with windows updates). It’s just an aspect of how Microsoft does those.
But for Windows 10, these are not distributed with the OS and must be installed separately.
If you make a package for server installation this is maybe not an issue but in my case I will distribute the installation to (hopefully) thousands of computers, and then I cannot depend on something that might be installed.
Anyhow, my issue here is that there is no documentation (that I can find) about this dependency, neither in the Erlang community nor in the Elixir community. The mix release documentation states
“Once a release is assembled, it can be packaged and deployed to a target, as long as the target runs on the same operating system (OS) distribution and version as the machine running the
mix release command.”
Due to this dependency, this is not true.
But I should stop whining and contribute instead so I’ll post an issue for mix instead.
Well, no one states that there is a runtime requierement of
libc beeing available when targetting linux. Some things are such common to be available, that they just don’t get mentioned.
And from my limited experience with windows over the last 5 years, it seems as if the C++ runtime libraries are installed with about every program you install anyways…
So why not just create a MSI which does install the libraries as well as the release? Seems to be the way to go for windows anyway…