[erlang-questions] Relocating Erlang installation on Windows?
Scott Lystig Fritchie
Thu May 29 19:42:12 CEST 2008
Johan Holmberg <> wrote:
jh> I wonder if there is some way of getting the installation "position
Not that I'm aware of. (I'm just catching up on my mailing list reading
and noticed that no one (?) has replied to your query.)
We use a shell script to relocate builds of R11B-5 on Linux, which is
included below. It mostly works, but since we don't use "escript" and
some of the other scripts, I don't know if it does 100% the right thing
with all the scripts. It also doesn't do anything with Windows-only
files. Hope it helps.
--- snip --- snip --- snip --- snip --- snip --- snip ---
## For copying when configured via:
## ./configure --prefix=/some/place/that/is/not/the/final/installation/dir
if [ "X$1" = "X-d" ]; then
if [ $# -ne 3 ]; then
echo usage: $0 [-d] src-dir dst-dir path-dir
echo example: $0 /usr/local/gemini/erlang /new/dir /new/dir
echo "NOTE: In most cases, dst-dir and path-dir will be the same."
echo " However, in some weird NFS cases, the dst-dir (where"
echo " this script will copy files) may be different from"
echo " path-dir (where final users will use/execute files)."
echo NOTE: Both directories should be absolute paths.
if [ ! -d $SRCDIR ]; then
echo "Source directory $SRCDIR does not exist, aborting!"
if [ ! -d $DSTDIR ]; then
echo "Destination directory $DSTDIR does not exist, creating"
if [ $? -ne 0 ]; then
echo "mkdir $DSTDIR failed, aborting!"
echo -n "Copying files from $SRCDIR to $DSTDIR ... "
(cd $SRCDIR ; tar cf - $TAR_DEL_ARG .) | (cd $DSTDIR ; tar xfp -)
echo -n "Performing relocation steps ... "
for f in dialyzer epmd erl erlc escript run_erl start to_erl typer
if [ -h $f ]; then
rm -f $f
# Use wildcard to be Erlang-version-flexible (hopefully)
ln -s ../lib/erlang/erts-*/bin/$f ./$f
for f in erl start start_erl
perl -np -e "s|%FINAL_ROOTDIR%|$NEW_ROOTDIR|" < $f.src > $f
if [ -f $DSTDIR/lib/erlang/bin/$f ] ; then
cp $f $DSTDIR/lib/erlang/bin/$f
ln -s ../erts-*/bin/epmd ./epmd
echo "To use the new runtime environment, add the following directory"
echo "to your shell's PATH variable:"
echo " $DSTDIR/bin"
More information about the erlang-questions