Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread Display Modes
Old 25th February 2021, 11:35   #1
Junior Member
Join Date: Oct 2020
Posts: 47
can SimpleSC::GetErrorMessage be used outside the function or macro it is called?

using NSIS Simple SC plugin i am trying to manipulate services and get return value. however i am not able to use Get Error message outside a function or macro. is it possible.. below is my sample code

!macro ServiceStop serviceName Timeout
Push $0
Push $1
SimpleSC::ExistsService "${ServiceName}"
Pop $0
$0 = 0
SimpleSC::GetServiceStatus "${serviceName}"
${If} $0 == 0
${If} $1 != 1
SimpleSC::StopService "${serviceName}" 1 ${Timeout} ; 1 - wait 60 - timeouts in secs
Pop $0
Pop $1
Exch $0

Function GetServiceErrorReturnCode
Exch $0
${If} $0 != 0
Push "0 not equal 0. service action returned $0 ."
Push $0
Pop $0
Pop $0

!macro GetServiceErrorReturnCode RetCode
Push "${RetCode}"
Call GetServiceErrorReturnCode
!macroend Section

!insertmacro ServiceStop "SN" 10
Pop $0
${If} $0 != 0
!insertmacro GetServiceErrorReturnCode $0
MessageBox MB_OK "$0"
shekara is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump