elixir-lang/elixir-windows-setup

Elixir/Erlang Installation Mismatch

RoboZoom opened this issue · 19 comments

Current installer offers mismatched OTP/Elixir builds.

Per this issue (elixir-lang/elixir#12153), OTP v25 and Elixir v1.14 must be matched. The current installer installs OTP v24 instead of OTP v25.

Hi @RoboZoom, I could not reproduce this. The installer asks me which Erlang version to install and it shows Erlang/OTP 25 in the list. Perhaps you had Erlang already installed? Can you please show a print of your screens?

I could confirm that, if Erlang is already installed, we don't prompt to update it. We would need to address this.

This tracks with my experience. I thought, given the installer prompts, that Erlang was being automatically installed in the background. I did experience this issue when updating a preexisting Elixir installation on my machine.

This being said, I do believe that while troubleshooting, I manually removed Elixir (and I thought Erlang) and attempted a fresh install. I will try to reproduce in the morning and report my findings (with screenshots to assist).

I reproduced the installation process this morning. As an initial state, I had Elixir/Erlang/OTP installed via Scoop (under a C:\Users\... directory path), however my system-wide state was clean.

I ran through the installation process, and then reinstallation process and in both cases the result was the same. Elixir was installed, Erlang/OTP was not.

Erl Screen 1

Erl Screen 2

As shown in the screen shots, the installer definitely leads me to believe that Erlang is being loaded.

Erl Screen 3

The summary of tasks indicate that the Erlang folder should be appended to PATH, but does not indicate that Erlang OTP will be installed. This seems to reflect actual behavior. The Erlang folder is indeed added to PATH, but as shown below, no installation is added to C:\Program Files

Erl Screen 4

I believe that my problem before was that my previous Erlang version was still present. However if I had started from scratch, Erlang would be straight up missing (unless my Scoop installation is detected via the installer).

Edit: Clarification incorporated inline above regarding the summary task view and actual behavior of the installer.

The installer does try to detect the current Erlang version. If one is found, it doesn't ask you to update it. We should change it so it always asks if you want to update or not. :)

Thanks for the follow up!

The installer does try to detect the current Erlang version. If one is found, it doesn't ask you to update it. We should change it so it always asks if you want to update or not. :)

Thanks! Where does it look to detect a current Erlang Installation?

From my understand of the code, it looks in the Windows Registry for certain keys added by the Erlang installer.

That tracks - and interestingly, the registry keys (for me) are pointed at folders that no longer exist. It was not pointing at my current installation, but my earlier removed installations.

It might be helpful to also detect whether the paths in the registry keys are valid (so as to assert whether Erlang must be installed), or whether an update prompt is desirable.

I'm not familiar with the installer scripting, but I will see if I can help out.

It might be helpful to also detect whether the paths in the registry keys are valid (so as to assert whether Erlang must be installed), or whether an update prompt is desirable.

Ah, noted! /cc @chyndman

Thanks for reporting and investigating! In src/ErlangInstall.iss we just check whether HKEY_LOCAL_MACHINE\SOFTWARE\(Wow6432Node\)Ericsson\Erlang exists or not. We use this in ElixirWeb.iss to show or hide the Erlang install option.

Sounds like what we want instead is for Erlang installation to always be offered; perhaps also allow the user to select a version like we offer for Elixir, and then maybe emit a warning if something looks mismatched or Erlang might already be installed.

I plan to address this when time permits. There's some other updates I'll need to perform first due to upstream Inno Setup changes.

José, by way of feedback and in reply to your forum post, it was this issue that forced me to have Erlang installed separately on my Windows machine. I cannot remember why I installed Erlang, but once I did, there was no way out. Not until Chris pointed to the HKEY_LOCAL_MACHINE\SOFTWARE(Wow6432Node)Ericsson\Erlang registry key. Well, it only took me 5 years to find out...

Thanks for the reminder, I'd forgotten to follow up on this task. I just pushed version 2.4 which at least gives the option to install Erlang even if the installer thinks it's already present. There are other enhancements we can make, but this change alone at least gives a "way out" for people with existing installs.

This is awesome @chyndman, thank you so much! I have one last suggestion, if possible.

I have added a column named min_otp_release to elixir.csv, do you think it would be possible to either:

  • Check what is the Erlang version currently installed and keep the checkbox checked if is older than the one necessary?

  • If that's too tricky (for example, maybe the Erlang version is not in the registry), what do you think about changing the flow a little bit to force the users to make a decision? Instead of a checkbox, we can have a "Skip" button at the bottom. And then if Erlang is already installed we just show a warning saying: "There is already an Erlang/OTP installed on your machine. You may skip this step but note Elixir vX.Y.Z requires Erlang/OTP MIN or later." - the reason for this is because if someone does not care and just wants to press "next, next, next", they will always install it, which is more likely to work than accidentally skipping the step because the checkbox is disabled.

What do you think?

Thank you and happy new year! ❤️ 🍾

Here's what the Tasks page looks like:

image

We can't really change to a Skip button, but what we can do is throw up a dialog box when the user selects Next. Here we can let the user know there's a problem and let them reconsider. Here's a sample:

image

As for the version check, would it be possible to use the ERTS version in elixir.csv? I don't know which one Elixir cares more about. Here's what the registry looks like when I install OTP 25.2.1:

image

There's also an Install.ini file in the Erlang folder:

[Install]
VSN=13.1.4
SYSTEM_VSN=25

We could translate between OTP and ERTS using erlang.csv but using ERTS might be more reliable especially when users have multiple Erlang installs side by side.

So what if we keep the checkbox always checked and, if they select to defer, we show the warning right below the checkbox saying they need to have at least certain OTP version? :)

I wanted to bring up an issue that I noticed with the current installer for Elixir/Erlang. It seems that there is a mismatch between the OTP and Elixir builds. According to this issue on GitHub (elixir-lang/elixir#12153), OTP version 25 and Elixir version 1.14 must be matched. However, the current installer is installing OTP version 24 instead of version 25.

The Elixir installer uses only the first row of https://github.com/elixir-lang/elixir-lang.github.com/blob/main/erlang.csv to determine which Erlang installer to employ. It was last updated September 2022 to include OTP 25. If you try again recently it should offer this version.

We are now building and shipping offline Elixir installers per Erlang/OTP version which are built as part of CI. See the up to date instructions on elixir-lang.org to learn more. :)