We are working on converting the wiki to a static website controlled by markdown files in https://github.com/nsis-community. You can already see there how plug-ins will be posted. The end-user interface will still be a website but with a fresh coat of paint. Come meet us at Discord to talk about it.
NSIS Simple Service Plugin
Links
GitHub repository - source code, documentation and issue tracker
Download the latest version (ANSI and Unicode builds)
Description
SimpleSC is an NSIS plugin to manage Windows services. It contains basic functions like installing, removing, starting or stopping a service and checking the service status, as well as advanced functions for example setting the service description, changing the logon account, configuring failure actions and granting or removing the service logon privilege.
Installation
- ANSI build: copy SimpleSC.dll to Plugins\x86-ansi (NSIS 3) or Plugins (NSIS 2)
- Unicode build: copy SimpleSC.dll to Plugins\x86-unicode (NSIS 3 with Unicode true)
Example
; Install a service - ServiceType own process - StartType automatic - NoDependencies - Logon as System Account SimpleSC::InstallService "MyService" "My Service Display Name" "16" "2" "C:\MyPath\MyService.exe" "" "" "" Pop $0 ; returns an errorcode (<>0) otherwise success (0) ; Start a service SimpleSC::StartService "MyService" "" 30 Pop $0 ; returns an errorcode (<>0) otherwise success (0) ; Stop a service and waits for file release SimpleSC::StopService "MyService" 1 30 Pop $0 ; returns an errorcode (<>0) otherwise success (0) ; Remove a service SimpleSC::RemoveService "MyService" Pop $0 ; returns an errorcode (<>0) otherwise success (0)
The complete function reference with all parameters and examples is available in the README on GitHub.
Questions and bug reports
Please use the issue tracker on GitHub.