[erlang-questions] Erlang on Windows from USB

Robert Raschke rtrlists@REDACTED
Mon Nov 30 18:35:00 CET 2009


On Mon, Nov 30, 2009 at 4:58 PM, Giuseppe Luigi Punzi <
glpunzi@REDACTED> wrote:

> Hi all,
>
> There are some way, to use erlang from an USB? I, and a friend, we have
> a machine where we can't do installations. We need a "portable" erlang
> to develop.
>
> I installed on a WinXP box. Copied the erlang entire folder to my USB,
> and tried to run in from other WinXP machine. I updated the paths in
> "erl.5.7.4\bin\erl.ini" but, when try to run "erl.5.7.4\bin\erl.exe"
> gives me an error:
>
> "G:\Desarrollo\erl5.7.4\bin\erl.exe
> The aplication couldn't be started because it's configuration is
> incorrect. Reinstall the application could solve the problem"
>
> In the ini file, I updated the paths with double slash "\\".
>
> Cheers, and thanks.
>

In the bin folder of your Erlang installation on Windows, you will find an
erl.ini file. This contains some absolute paths that need to point to the
correct locations of your installation root and the erts bin folder within
that.

As far as I am aware, the paths must be absolute (starting with drive letter
and initial backslash) and all folder separators must be escaped backslashes
(\\).

You could make yourself a small batch file to start Erlang after having
written over the erl.ini file. For example (using R12B, in R13B the erts
version'll be different):

setlocal
set ROOT=%~dsp0%
set ERTSPATH=%ROOT%erts-5.6.5\bin
set ERLINI=%ERTSPATH%\erl.ini
echo [erlang] >%ERLINI%
echo Bindir=%ERTSPATH:\=\\% >>%ERLINI%
echo Progname=erl >>%ERLINI%
echo Rootdir=%ROOT:\=\\% >>%ERLINI%
%ERTSPATH%\erl
endlocal

Put this into your Erlang root on the USB drive and you should be able to
run it from there. (BTW, this batch file ignores the top level bin folder
and uses the erts one directly.)

And then adapt to pass in whatever options you need, set a better PATH to
include OpenSSL, etc.

Getting all this correct with erlsrv.exe for running Erlang as a Windows
Service is a lot harder!

Hope this helps,
Robby

PS The magic %~dsp0% is explained here:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx


More information about the erlang-questions mailing list