Skip to content

Commit

Permalink
Check return code when starting ncdns service
Browse files Browse the repository at this point in the history
Refs #71
  • Loading branch information
JeremyRand committed Feb 11, 2021
1 parent a66287d commit 77b989b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ncdns.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ Var /GLOBAL BitcoinJRequirementsMet
Var /GLOBAL BitcoinJRequirementsError
Var /GLOBAL ETLD

Var /GLOBAL ServiceStartReturnCode

# PRELAUNCH CHECKS
##############################################################################
!Include WinVer.nsh
Expand Down Expand Up @@ -970,7 +972,14 @@ Function Service
FunctionEnd

Function ServiceStart
nsExec::Exec 'net start ncdns'
DetailPrint "Starting ncdns service..."
nsExec::ExecToLog 'net start ncdns'
Pop $ServiceStartReturnCode
${If} $ServiceStartReturnCode != 0
DetailPrint "Failed to start ncdns service: return code $ServiceStartReturnCode"
MessageBox "MB_OK|MB_ICONSTOP" "Failed to start ncdns service." /SD IDOK
Abort
${EndIf}
FunctionEnd

Function un.Service
Expand Down

0 comments on commit 77b989b

Please sign in to comment.