Skip to content

Commit

Permalink
Check return code when starting ncdns service
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Mar 2, 2021
1 parent 1b37229 commit b7157ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ncdns.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Var /GLOBAL ServiceCreateReturnCode
Var /GLOBAL ServiceSidtypeReturnCode
Var /GLOBAL ServiceDescriptionReturnCode
Var /GLOBAL ServicePrivsReturnCode
Var /GLOBAL ServiceStartReturnCode
Var /GLOBAL CoreCookieDirReturnCode
Var /GLOBAL CoreCookieFileReturnCode
Var /GLOBAL EtcReturnCode
Expand Down Expand Up @@ -1101,7 +1102,13 @@ Function ServiceEventLog
FunctionEnd

Function ServiceStart
nsExec::Exec 'net start ncdns'
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 b7157ba

Please sign in to comment.