nsisServices


Introduction

When installing a new program or updating an installation, it's good practice for you to stop an installed application and anything related with it before overwriting any of its files. The same goes for services. We need to be sure that the locally run service (if any) is stopped before we can install or upgrade our program. In this topic I'll share a few macros ranging from creating a service to querying a service to removing one all together.

Syntax

  • ${Service::Create} "NAME" "PATH" "TYPE" "START" "DEPEND" /DISABLEFSR $0 $1
  • ${Service::Remove} "NAME" "" $0 $1
  • ${Service::QueryConfig} "NAME" /DISABLEFSR $0 $1

Parameters

${Service::Create}Description
NAMEThe service name
PATHBinaryPathName to the .exe file
TYPEown, share, interact, kernel, filesys, rec
STARTboot, system, auto, demand, disabled, delayed-auto
DEPENDDependencies(separated by / (forward slash))
/DISABLEFSRDisables redirection if x64. Use "" to skip.
$0Return after call
$1Return after call