NsSCM plug-in: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Service Control Manager plugin (install services and drivers on NT/2K/XP) moved to NsSCM plug-in) |
|||
Line 42: | Line 42: | ||
qewrqwer | |||
nsSCM::Start /NOUNLOAD "XXX" | nsSCM::Start /NOUNLOAD "XXX" |
Revision as of 12:50, 17 January 2006
Author: sl (talk, contrib) |
nsSCM stands for Service Control Manager.
This plugin can be used to install/remove services, start or stop them and check their current status. Useful if you want to install a background service or a driver.
The new version fixes a bug which prevented nsSCM to install a service under a specified account.
Links
NsSCM.zip (8 KB) The ZIP file containing a precompiled plugin DLL (to be saved in NSIS' plugin directory) and the sources.
Short Reference
Available commands:
nsSCM::Install [name_of_service] [display_name] [service_type] [start_type] [service_commandline] [load_order_group] [dependencies] [account] [password] nsSCM::Start [name_of_service] nsSCM::Stop [name_of_service] nsSCM::QueryStatus [name_of_service] nsSCM::Remove [name_of_service]
Parameters:
- name_of_service - the name of the service used for Start/Stop commands and all further nsSCM commands
- display_name - the name as shown in the service control manager applet in system control
- service_type - one of the following codes
- 1 - device driver
- 16 - service
- start_type - one of the following codes
- 0 - driver boot stage start
- 1 - driver sscm stage start
- 2 - service auto start
- 3 - driver/service manual start
- service_commandline - the path to the binary including all necessary parameters
- load_order_group - controls the order of service starts
- dependencies - needed services, controls which services have to be started before this one
- account - the account which should be used to run the service
- password - password of the aforementioned account to be able to logon as a service
If you do not specify account/password, the local system account will be used to run the service.
qewrqwer
nsSCM::Start /NOUNLOAD "XXX" Pop $0 ; return error/success
nsSCM::QueryStatus /NOUNLOAD Pop $0 ; return error/success Pop $1 ; return service status
IntCmp $1 4 lbl_Return ; check on running
</highlight-nsis>