elixir-lang/elixir-windows-setup

Windows shortcut points to wroing `werl.exe`

chowevtfy opened this issue · 12 comments

There's an incorrect werl.exe path in the shortcut installed with Elixir using the Windows installer. The path currently is %USERPROFILE%\Desktop\werl.exe but it works if you change it to C:\Program Files\erl7.1\bin\werl.exe. I think that maybe it's best to not assume werl.exe exists on the Desktop?

Can you send a PR? :) /cc @chyndman

Yeah, I will after work.

Here is the entry in question which handles the shortcut.

It actually isn't hardcoded to the desktop. The installer will search in your PATH for werl.exe and will use the path it finds for the shortcut. For some reason this works about 80% of the time, and the other 20% it defaults to the desktop. So hardcoding the path would be the easiest thing to do but would require changing every time a new Erlang is released. I might have time to work on a more convoluted workaround.

That said, I think today's solution is great, thank you @chyndman.

@chowetno, I am closing this but if you have a better idea in mind please let us know!

Yeah, I guess you just have to install Erlang first. Maybe we can have an option to automatically install Erlang?

The installer already asks you to do that if it can't find one. :)

That's the problem. I just tested reinstalling Elixir/Erlang with that option, and Elixir doesn't pick up the new PATH after the Erlang install. (EDIT: oh, I can't reopen it, can you?)

When you reinstalled, did you reinstall just Elixir, or Erlang as well? Installation path information is stored in the registry, so its inability to clean up stale values might be to blame here.

In any case, I'm thinking that the way to fix this might be to add a step in the offline or web installer that helps the user confirm the path where Erlang was installed, and use that value explicitly for the shortcut.

I uninstalled Erlang and removed all of its entries in the PATH. Then I uninstalled Elixir and re-installed it using the option to get Erlang automatically.

Hey guys, I've got stuff in the windows batch files in exrm to find the location of the Erlang install at runtime via a batch file. You may want to take a look at the stuff I've done: https://github.com/bitwalker/exrm/blob/master/priv/rel/files/boot.bat (yes that's Paul's repo but it's my changes that he pulled in :) ) Specifically between lines 108-119

I've published v1.03 which might fix this issue. I say "might" because it addresses the nondeterminism mentioned above but I might need to add an extra installer step to explicitly verify the Erlang path with the user.

v2.0 is out which will now use a user-verified path for the werl shortcut. Thanks for reporting this issue!