https://github.com/chrispulman/serviceinstaller
A Library to handle installation of windows services
https://github.com/chrispulman/serviceinstaller
installer net6 net7 netstandard20 services
Last synced: about 1 year ago
JSON representation
A Library to handle installation of windows services
- Host: GitHub
- URL: https://github.com/chrispulman/serviceinstaller
- Owner: ChrisPulman
- License: mit
- Created: 2023-03-26T07:34:55.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T19:33:30.000Z (about 2 years ago)
- Last Synced: 2024-05-27T14:07:41.301Z (about 2 years ago)
- Topics: installer, net6, net7, netstandard20, services
- Language: C#
- Homepage:
- Size: 530 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ServiceInstaller
A Library to handle installation of .net applications as services
## Usage
### Installation
Install the package from nuget
Install-Package ServiceInstaller
### Usage
```C#
using ServiceInstaller;
// Check if the args include a command
var hasCmd = args.Length > 0? args[0].Count(ch => ch == '-') : 0;
switch (hasCmd)
{
case 1:
// Handle service request
Console.WriteLine(ServiceController.HandleRequest(args[0], "YourServiceName", "Display Name Of Your Service"));
break;
default:
{
// Run normally
// Your code here
break;
}
}
```