I would like to specify an arbitrary service name for a Windows service.
This is because I want to allow end users to run commands like sc.exe [stop|start] myservice.
I expected this to be possible by renaming wsw.exe, but the SERVICE_NAME_PREFIX is defined as a fixed constant:
pub const SERVICE_NAME_PREFIX: &str = "wsw";
If we want to allow arbitrary service names, possible approaches include:
- Retrieving the name from the executable file using env::current_exe()
- Specifying the name as an option during installation
Which approach do you prefer?
Let's organize the naming as follows.
- Application name (-n option): app
- Service name prefix: wsw
- Sservice name: wsw-app
I would like to specify an arbitrary service name for a Windows service.
This is because I want to allow end users to run commands like sc.exe [stop|start] myservice.
I expected this to be possible by renaming wsw.exe, but the SERVICE_NAME_PREFIX is defined as a fixed constant:
If we want to allow arbitrary service names, possible approaches include:
Which approach do you prefer?
Let's organize the naming as follows.