Minimal setup to run elixir release in a fresh machine

Background

I have a very minimal Elixir desktop app called hello-desktop:

Which I have compiled and released in a Windows 10 VM using mix release.

Now in another Windows 10 machine, I downloaded the repo and I have installed erlang for Windows:

My thought process is that since I created the release with everything installed I should not need to install anything at all in the new machine to run my hello.bat.

releases: [
        hello: [
          include_executables_for: [:windows],
          applications: [runtime_tools: :permanent]
        ]
      ]

However, I still went ahead and installed erlang with OTP 24 to discard it as a possible mistake.

Problem

The problem here is that when I run the bat file created by mix release in my second VM I get the following error:

 .\hello.bat start
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.

Which is very confusing. What path is it looking for?
In theory the VM should be all I need. I shouldn’t need Elixir installed. To be honest, since I believe I am creating the release with everything included, I should not even need erlang installed.

What am I doing wrong?

Answer

My mistake was to think that the single file called hello.bat was all I needed to run everything. In reality, as far as I now understand, that is only an entry point.

Turns out you can run an elixir release in a fresh machine, with everything included, if you bring along the full _build folder with you.

Basically, after zipping the entirety of the _build folder, sending it to a new fresh machine without Elixir or Erlang installed, and then unzipping it and running the hello.bat inside, everything worked.

I was also quite surprised. I don’t know which files inside the _build folder are needed specifically, but I am guessing that everything inside of _build/prod is there for a reason and so should be brought with your release.

This is specially incredible to me, as it also include third part tools, like :wx should you need them.

1 Like

Minor correction: Only _build/prod/rel/YOUR_APP is needed.

1 Like

You should give a look at GitHub - bake-bake-bake/bakeware: Compile Elixir applications into single, easily distributed executable binaries, it creates a single executable file from the release.

3 Likes