Description
In src/Servy.Core/Services/ServiceManager.cs (line 462):
_ = UpdateServiceConfig(
scmHandle: scmHandle,
serviceName: options.ServiceName,
description: options.Description,
binPath: binPath,
startType: options.StartType,
username: lpServiceStartName,
password: lpPassword,
lpDependencies: lpDependencies,
displayName: displayName
);
The _ = pattern explicitly discards the bool return value. While UpdateServiceConfig throws Win32Exception on some failures, the bool return indicates whether the underlying ChangeServiceConfig call succeeded. The install flow reports success even if the existing service's configuration was not actually updated.
Severity
Warning — install may report success when the service configuration update failed.
Suggested fix
Check the return value and handle the failure case:
bool updated = UpdateServiceConfig(...);
if (!updated)
{
Logger.Warn("Failed to update existing service configuration.");
}
Description
In
src/Servy.Core/Services/ServiceManager.cs(line 462):The
_ =pattern explicitly discards theboolreturn value. WhileUpdateServiceConfigthrowsWin32Exceptionon some failures, theboolreturn indicates whether the underlyingChangeServiceConfigcall succeeded. The install flow reports success even if the existing service's configuration was not actually updated.Severity
Warning — install may report success when the service configuration update failed.
Suggested fix
Check the return value and handle the failure case: