-
StackOverflow 文档
-
nsis 教程
-
服务
-
ServiceRemove
##=
#= Service::Remove
#
# USAGE:
# ${Service::Remove} "NAME" /DISABLEFSR $0 $1
#
# ::Remove = Deletes a service entry from the registry.
# NAME = The Service name
# /DISABLEFSR = Disables redirection if x64. Use "" to skip.
# $0 = Return after call
# $1 = '' '' ''
#
# Be sure to stop a service first if it's running.
#
!define Service::Remove `!insertmacro _Service::Remove`
!macro _Service::Remove _SVC _FSR _ERR1 _ERR2
StrCmpS $Bit 64 0 +4
StrCmp "${_FSR}" /DISABLEFSR 0 +3
ExecDos::Exec /TOSTACK /DISABLEFSR `"${SC}" delete "${_SVC}"`
Goto +2
ExecDos::Exec /TOSTACK `"${SC}" delete "${_SVC}"`
Pop ${_ERR1}
Pop ${_ERR2}
!macroend