Service Installation Steps
Describe the bug
Documentation leads on to https://github.com/ChangemakerStudios/Papercut-SMTP/blob/develop/src/Papercut.Service/Readme.md for steps to install as a service. Latest version does not respond to CLI parameters so install --help -h all start the service instead.
To Reproduce Steps to reproduce the behavior:
- Download the ZIP with the service
- Unzip to a folder
- Try the documented CLI
Expected behavior A clear and concise set of steps to install the service to windows services.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows
- Version: 7.0.1
Related to #278
FYI : I attempted to follow Microsoft's steps hoping that it might help - but the first line of code Console.Title = AppMeta.AppName; triggers an exception
Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.IOException: The handle is invalid. at System.ConsolePal.set_Title(String value) at Papercut.Service.Program.Main(String[] args) in C:\projects\papercut-smtp\src\Papercut.Service\Program.cs:line 42 at Papercut.Service.Program.<Main>(String[] args)
Seems like this was never tested as a windows 'service'
100% a problem. Some of the documentation about installing as a service is wrong too.
The easiest way to install is with either sc.exe or with the New-Service powershell cmdlet.
The fix to the code is maybe pretty trivial.
I think you just need to do something like:
if (Environment.UserInteractive)
{
Console.Title = AppMeta.AppName;
}
And providing there are no more direct references to Console it will probably happily run as a service. I'll check this and report back :-)
Confirmed this is fixed in the latest build. Thanks @ian-gratton-citation for pointing me at the issue.