Skip to content

Commit

Permalink
Windows: Delay service startup on boot
Browse files Browse the repository at this point in the history
Use "Automatic (Delayed Start)" as a workaround for eturnal failing to
start up after reboot on Windows.

See: erlware/relx#878
  • Loading branch information
weiss committed May 12, 2022
1 parent 5d4c63a commit 9b452ea
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ project adheres to [Semantic Versioning][SemVer].
- Binary release: Use new (GCC-11.2-based) version of build toolchain.
- Binary release: Provide self-extracting installer for non-DEB/RPM systems.

### Fixed
- Windows: Don't fail to start up after reboot.

## [1.8.2] - 2022-03-02
### Changed
- Use a (pseudo)random `secret` by default.
Expand Down
5 changes: 3 additions & 2 deletions scripts/make-release
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ fi
echo "$myself: Editing repository files ..."
sed -i -e "s|^rel_vsn=.*|rel_vsn='$new_vsn'|" 'scripts/get-version'
sed -i -e "s|$(echo "$old_vsn" | sed 's/\./\\./g')|$new_vsn|g" \
'README.md' 'INSTALL.md' 'doc/overview.edoc' 'windows/eturnal.iss'
'README.md' 'INSTALL.md' 'doc/overview.edoc' \
'windows/eturnal.iss' 'windows/delay-start.cmd'
sed -i -e "s|^rebar_vsn=.*|rebar_vsn='$rebar_vsn'|" \
'scripts/make-source' 'scripts/make-binaries'
sed -i -e "s|compare/$old_vsn|compare/$new_vsn|" \
Expand All @@ -73,7 +74,7 @@ sed -i -e "s|compare/$old_vsn|compare/$new_vsn|" \
echo "$myself: Committing result ..."
git add 'rebar.config' 'CHANGELOG.md' 'README.md' 'INSTALL.md' \
'doc/overview.edoc' 'scripts/get-version' 'scripts/make-source' \
'scripts/make-binaries' 'windows/eturnal.iss'
'scripts/make-binaries' 'windows/eturnal.iss' 'windows/delay-start.cmd'
git commit -m "Release $new_vsn"
git -P show
read -p "$myself: Does the commit look fine? (y/n) [n] " response
Expand Down
9 changes: 9 additions & 0 deletions windows/delay-start.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@echo off
set rel_name="eturnal"
set rel_vsn="1.8.2"
setlocal enabledelayedexpansion
for /f "tokens=3" %%i in ('sc getkeyname %rel_name%_%rel_vsn%') do (
set svc_name=%%i
)
sc config %svc_name% start= delayed-auto
endlocal
1 change: 1 addition & 0 deletions windows/eturnal.iss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Name: {group}\Web Site; Filename: {app}\doc\eturnal.url
[Run]
Filename: {app}\bin\eturnal.cmd; Parameters: install; WorkingDir: {app}; Flags: runhidden
Filename: {app}\bin\eturnal.cmd; Parameters: start; WorkingDir: {app}; Flags: runhidden
Filename: {app}\bin\delay-start.cmd; Flags: runhidden

[UninstallRun]
Filename: {app}\bin\eturnal.cmd; Parameters: stop; WorkingDir: {app}; Flags: runhidden; RunOnceId: StopService
Expand Down

0 comments on commit 9b452ea

Please sign in to comment.