aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin_windows
diff options
context:
space:
mode:
authorLuis Rascão <[email protected]>2017-11-17 21:20:35 +0000
committerGitHub <[email protected]>2017-11-17 21:20:35 +0000
commita3c7263856236539278a8019fded8f66e36938f7 (patch)
treef03e9b577c54cd748ab68b7864143498a95b9351 /priv/templates/extended_bin_windows
parentc8e597d300b7f3bc79b7971e955b9b06a90d803b (diff)
parent69dafa2b0a22ca4f266f730342ff3d6b1802767b (diff)
downloadrelx-a3c7263856236539278a8019fded8f66e36938f7.tar.gz
relx-a3c7263856236539278a8019fded8f66e36938f7.tar.bz2
relx-a3c7263856236539278a8019fded8f66e36938f7.zip
Merge pull request #624 from ferd/relup-windows
Fix release upgrades on Windows
Diffstat (limited to 'priv/templates/extended_bin_windows')
-rw-r--r--priv/templates/extended_bin_windows12
1 files changed, 8 insertions, 4 deletions
diff --git a/priv/templates/extended_bin_windows b/priv/templates/extended_bin_windows
index d0c41d8..5f22e4f 100644
--- a/priv/templates/extended_bin_windows
+++ b/priv/templates/extended_bin_windows
@@ -48,6 +48,12 @@
set node_name=%%J
)
+@if "-sname" == "%node_type%" (
+ set hostname="%COMPUTERNAME%"
+) else (
+ set hostname="%COMPUTERNAME%.%USERDNSDOMAIN%
+)
+
:: Extract cookie from vm.args
@for /f "usebackq tokens=1-2" %%I in (`findstr /b \-setcookie "%vm_args%"`) do @(
set cookie=%%J
@@ -160,9 +166,7 @@ set start_erl=%erts_dir%\bin\start_erl.exe
set description=Erlang node %node_name% in %rootdir%
@if "" == "%2" (
:: Install the service
- %erlsrv% add %service_name% %node_type% "%node_name%" -c "%description%" ^
- -w "%rootdir%" -m "%start_erl%" -args "%args%" ^
- -stopaction "init:stop()."
+ %erlsrv% add %service_name% %node_type% "%node_name%" -c "%description%" -w "%rootdir%" -m "%start_erl%" -args "%args%" -stopaction "init:stop()."
) else (
:: relup and reldown
goto relup
@@ -193,7 +197,7 @@ set description=Erlang node %node_name% in %rootdir%
set ERRORLEVEL=1
exit /b %ERRORLEVEL%
)
-@%escript% "%rootdir%/bin/install_upgrade.escript" "install" "%rel_name%" "%node_name%" "%cookie%" "%2"
+@%escript% "%rootdir%/bin/install_upgrade.escript" "install" "{'%rel_name%', \"%node_type%\", '%node_name%@%hostname%', '%cookie%'}" "%2" "%3"
@goto :eof
:: Start a console