erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.38k stars 2.95k forks source link

Installing multiple Erlang versions on Windows #7054

Open inikulshin opened 1 year ago

inikulshin commented 1 year ago

Since #5524 it's impossible to manage multiple Erlang versions (independently install and uninstall).

Information about multiple installed Erlang version is lost, because the uninstall information in SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Erlang OTP is overwritten and thus contains information only about latest installed Erlang version.

In case of default INSTDIR (c:\Program Files\Erlang OTP), the files are partially overwritten and the older versions can't be used(?). Uninstall of the latest from Add or remove programs will at least remove all the files from previously installed Erlang versions.

In case of non-default INSTDIR, all the files from previously installed Erlang versions will be just lost and can't be removed from Add or remove programs.

inikulshin commented 1 year ago

The question is: should multiple Erlang OTP installations be supported or not?

If the answer is yes, installer must use different registry key/values, default installation directory and start menu directories - to support independent uninstall (like Visual Studio, I have 4 of them on my workstation).

If the answer is no, Erlang installer must detect previously installed Erlang version and exit until user uninstalls it manually. Allowing user to uninstall the previously installed version in installation wizard (and in silent mode) is also an option, but it's complex, as all erl.exe and erlsrv.exe processes should be stopped, and services will usually start them immediately...

dgud commented 1 year ago

The default should overwrite previous installations ala windows style, so that upgrading via nuget or winget works.

You can have several installations today if you change the default installation directory. Would be great if uninstall via Add or Remove programs worked, if you find a solution please send a PR. But fixing that is way down on our priority list.

inikulshin commented 1 year ago

@dgud there are at least 2 windows installation styles: the one that replaces/upgrades previously installed software (e.g. RabbitMQ), and the one that allows multiple versions of the "same" software (e.g. Visual Studio, Office, Python).

I think, like for all other programming languages, it can be useful to have multiple Erlang versions installed simultaneously: for benchmarking, for compatibility checks, etc.

By the way, what's the approach in other OS'es (Linux, MacOS)?

I'll be glad to send you a PR, but please, decide on an approach (I'm still trying to convince you to choose to support multiple versions... :)

dgud commented 1 year ago

I want both, by default install and replace. If you users install somewhere else i.e. in path with version number it installs there and (s)he can have multiple versions.

dgud commented 1 year ago

Btw, IMO RabbitMQ and applications should include the Erlang/OTP in their installer.

inikulshin commented 1 year ago

I want both, by default install and replace. If you users install somewhere else i.e. in path with version number it installs there and (s)he can have multiple versions.

Ok, what about this behavior:

  1. Installer will check for previously installed Erlang versions and will prompt either to uninstall them (default option) or to install next to them (the latter must be supported also in silent mode). If uninstall is chosen, Uninstaller.exe must run.
  2. Regardless of user's choice, installer must use different a. Registry key/values SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Erlang OTP ${OTP_VERSION} (${ERTS_VERSION}) b. Default installation directory C:/Program Files/Erlang OTP ${OTP_VERSION} (${ERTS_VERSION}) c. Start menu directories.
  3. To allow seamless upgrade and user experience, I suggest to have a link from C:/Program Files/Erlang OTP to the latest installed version specific directory (e.g. C:/Program Files/Erlang OTP 25.3 . The same is for Start Menu - either to link (don't know if it's possible), or to overwrite.