summaryrefslogtreecommitdiff
path: root/erts/etc/win32/nsis/vsn_number.escript
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc/win32/nsis/vsn_number.escript')
-rw-r--r--erts/etc/win32/nsis/vsn_number.escript16
1 files changed, 16 insertions, 0 deletions
diff --git a/erts/etc/win32/nsis/vsn_number.escript b/erts/etc/win32/nsis/vsn_number.escript
new file mode 100644
index 0000000000..7854860042
--- /dev/null
+++ b/erts/etc/win32/nsis/vsn_number.escript
@@ -0,0 +1,16 @@
+
+
+main([OtpVsn, WinPathFile]) ->
+ try
+ {ok, Bin} = file:read_file(WinPathFile),
+ <<"OTP-", _/binary>> = Bin,
+ case [list_to_integer(Str) || Str <- string:lexemes(OtpVsn, ".")] of
+ [_,_,_,_|_] -> io:format("~s~n", [OtpVsn]);
+ [_,_,_] -> io:format("~s.0~n",[OtpVsn]);
+ [_,_] -> io:format("~s.0.0~n",[OtpVsn]);
+ [_] -> io:format("~s.0.0.0~n",[OtpVsn])
+ end
+ catch _:_R:_ST -> %% release candidate or development branch set fake version as 0.0.0.0
+ %% io:format("Err: ~p ~p~n ~p~n",[_R,_ST, WinPathFile]),
+ io:format("0.0.0.0~n")
+ end.