Archive: servicelib.nsh


servicelib.nsh
I'm using servicelib.nsh and I want to check if some service is installed or not.
So I use: !insertmacro SERVICE "installed" "SMTPSVC" ""

But the question is what can I write in the action ?


According to the documentation, you should pass an action you wish to perform in case the service is installed. You'd probably want to pass "status" to check if it's running. But you can simply pass "status" right in the beginning and get "false", if it doesn't exist.


Sorry for a very stuped question but how do I use status? I mean how do I get a True or False from him?


The ServiceLib notes are missing a Pop instruction after the macro insertion:

!insertmacro SERVICE "installed" "SMTPSVC" ""
Pop $R0

$R0 will be either "true" or "false".
To check this value, use StrCmp. Or if you want to keep the code cleaner, use LogicLib.

-Stu


Yes thanks I already found it myself :)