TechieGuy12 / FileWatcher

A file and folder monitor that can send notifications, perform actions, or execute a command when a file or folder is changed.
MIT License
106 stars 27 forks source link

FileWatcher runnable as a Windows service #38

Closed ksmith3036 closed 1 year ago

ksmith3036 commented 1 year ago

Often FileWatching is something one want to have as a service started on boot of the machine. On Windows both a Scheduled Task and a Service may be used for this. With .NET it is quite easy to make the program runnable as a Windows service. Configuring a Scheduled Task is quite complex, while installing a service is quite easy.

See Windows-Service. To make installation even easier, I added a installer project using Wix 4. For the Wix project to build, Wix must be installed (dotnet tool install --global wix), as well as HeatWave for VS2022.

Please see if any of the ideas might be implemented in the new FileWatcher version in development.

One complaint from the users is logging, where the UTF-8 encoded logfile is without a BOM - Byte Order Marker. This makes some text editors and log viewers on Windows misunderstand the encoding so international characters are shown wrong. I made a minor change to Logger.cs, to make it create a BOM for logfiles on Windows.