All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Upgrade
windows-sys
dependency to 0.59 and bump the MSRV to 1.60.0
- Breaking: Add support for user-defined control codes in services.
(See:
Service::notify
andnotify_service.rs
example). This is breaking since theServiceControl
enum was exhaustive in version 0.6.0. - Breaking: Add support for
LidSwitchStateChange
inPowerBroadcastSetting
. This is breaking sincePowerBroadcastSetting
was an exhaustive enum in version 0.6.0. - Breaking: Add support for
SERVICE_SYSTEM_START
andSERVICE_BOOT_START
in service start type. This is breaking since theServiceStartType
enum is exhaustive. - Add function for obtaining service SID infos. (See:
Service::get_config_service_sid_info
).
- Breaking: Make a bunch of enums
#[non_exhaustive]
:Error
,PowerBroadcastSetting
,PowerEventParam
andServiceControl
. - Breaking: Upgrade
windows-sys
dependency to 0.52
- Add support for delayed autostart in services. (See:
Service::set_delayed_auto_start
) - Add support for specifying a preshutdown timeout. (See:
Service::set_preshutdown_timeout
) - Add function for obtaining service names from display names.
(See:
ServiceManager::service_name_from_display_name
)
- Breaking: Consolidate
Error
type. Remove dependency onerr-derive
. - Breaking:
Service::delete
does not consumeself
any longer. Make sure todrop
a reference toService
manually if you plan to poll SCM synchronously to determine when the service is removed from system. (Seeuninstall_service.rs
example)
- Implement
AsRawHandle
forServiceStatusHandle
. Allows using the service handles with other Windows APIs, not covered by this crate.
- Upgrade the crate to Rust 2021 edition and bump the MSRV to 1.58.0
- Breaking: Change
winapi
dependency towindows-sys
. This is a breaking change since some of the low level Windows types are exposed in the public API of this library. - Breaking: Update
widestring
dependency to 1.0 and remove it from the public API. - Breaking: Change
ServiceState::to_raw
to takeself
instead of&self
.
- Breaking:
ServiceDependency::from_system_identifier()
,ServiceManager::new()
,ServiceManager::local_computer()
,ServiceManager::remote_computer()
now takeimpl AsRef<OsStr>
arguments. - Upgrade err-derive dependency to 0.3.0
ServiceStatusHandle
is now Sync.
- Don't escape binary path for kernel drivers as they don't support that.
- Add support for service description. (See:
Service::set_description
)
- Fix segmentation fault in
Service
functions, that query service config, by moving buffer allocation to heap.
- Add support for configuring the service SID info.
- Add support for changing mandatory configuration settings on service.
- Add support for service failure actions. (See:
ServiceFailureActions
,Service::update_failure_actions
,Service::get_failure_actions
,Service::set_failure_actions_on_non_crash_failures
,Service::get_failure_actions_on_non_crash_failures
) - Add support to pause and continue services. (See:
Service::pause
andService::resume
) - Use
QueryServiceStatusEx
when querying service status. Allows getting the process ID of a running service
- Bumped the MSRV to 1.34, because of err-derive upgrade which depend on quote, to use
Duration::as_millis()
and theTryFrom
trait. - Breaking:
ServiceManager::create_service()
now expects a borrowedServiceInfo
argument.
- Add
ServiceExitCode::NO_ERROR
constant for easy access to the success value. - Add
Service::start
for starting services programmatically. - Add
Service::query_config
for getting the config of the service. - Add
ServiceInfo::dependencies
for specifying service dependencies.
- Changed
service_control_handler::register
to accept anFnMut
rather than just anFn
for theevent_handler
closure. - Upgrade to Rust 2018. This raises the minimum required Rust version to 1.31.0.
- Replace error-chain error library with err-derive. So all error types are changed.
- Change
ServiceType
implementation to use thebitflags!
macro.
- Fix invalid pointer manipulations in service creation routine in ServiceManager.
- Fix memory leak in
service_control_handler::register
that did not releaseevent_handler
in the case of an error. - Treat FFI return code 0 as error, instead of treating 1 as success.
- Initial release with support for installing, uninstalling and implementing Windows services.