Start erlang packaging image in windows
In a linux environment, erlang generates an image package by running the systools: make_script ("", []) and systools: make_tar () commands, first installs the image package, and then installs the image package, replace erl. in src, and then output to erl again, and then use erl-sname cache-boot .. /releases/0.1.0/start to start the application. In windows, if you want to port the package to another computer, you need to take the following two steps:
First, modify Bindir and Rootdir in erts-5.9.1/bin/erl. ini, Rootdir corresponds to $ ROOT in Application name. script, so as to find the relevant lib package;
Second, use erl-boot .. to load and start.
To facilitate the startup, the first and second steps are merged. The bat script is used to double-click the script. The script is as follows:
@ Echo off
Color 0a
: Modify the path in erts/bin/erl. ini and install erts
Setlocal enbledelayedexpansion
: Get the current path
Set rootdir = % ~ Dp0
: Get the erts file name
Dir e */B> temp.txt
Set/p erts = <temp.txt & del temp.txt
: Specify the path of erts bin.
Set bindir = % rootdir % erts % \ bin
: Change \ In Path \\
Set rootdir =! Rootdir: \= \\!
Set bindir =! Bindir: \= \\!
: Delete erl. ini in the bin path and generate a new erl. ini file in the new path after replacement.
Cd % bindir %
Del erl. ini
Echo [erlang]> % bindir % \ erl. ini
Echo Bindir = % bindir %> % bindir % \ erl. ini
Echo Progname = erl> % bindir % \ erl. ini
Echo Rootdir = % rootdir %> % bindir % \ erl. ini
: Start the application
Erl-boot... \ releases \ 0.1.0 \ start