Skip to content
Permalink
Browse files

m

  • Loading branch information
pandolia committed Dec 4, 2019
1 parent 3103949 commit c3a472a9806bb0d9d1df4399de2c8ba8b8b24aa7
Showing with 14 additions and 16 deletions.
  1. +1 −1 outfiles/lastline.log
  2. +1 −1 readme.md
  3. +5 −4 src/Main.cs
  4. +7 −10 svc.conf
  5. BIN svc.exe
@@ -1 +1 @@
[2019-11-28 18:27:02] Stopped SampleWorker(c# version)
[2019-12-04 17:04:53] Stopped SampleWorker(c# version)
@@ -45,7 +45,7 @@ WorkingDir: worker
# 输出目录,程序运行过程的输出将会写到这个目录下面,请确保该目录已存在
OutFileDir: outfiles
# 程序输出的编码,如果不确定,请设为空或 none
# 程序输出的编码,如果不确定,请设为空
WorkerEncoding: utf8
```

@@ -323,7 +323,7 @@ private static string setPassword(string value)
private static string setDescription(string value)
{
description = removeOuterQuote(value.Trim());
return null;
return checkValid(description);
}

private static string setDisplayName(string value)
@@ -365,14 +365,14 @@ private static string readConfig()
private static void showConfig()
{
Print($"ServiceName: {serviceName}");
Print($"DisplayName: {displayName}");
Print($"Description: {description}");
Print($"Worker: {worker}");
Print($"Worker's fileName: {fileName}");
Print($"Worker's arguments: {arguments}");
Print($"WorkingDir: {workingDir}");
Print($"OutFileDir: {outFileDir}");
Print($"WorkerEncoding: {workerEncoding}");
Print($"Description: {description}");
Print($"DisplayName: {displayName}");
Print($"Domain: {domain}");
Print($"User: {user}");
Print($"Password: {password}");
@@ -426,7 +426,8 @@ public static int Main(string[] args)
Print($"Service {name} is already installed!");
return 1;
}
var _args = $"create {name} binPath= \"{BinPath}\" start= auto DisplayName= \"{displayName}\"";
var _args = $"create {name} binPath= \"{BinPath}\" start= auto "
+ $"DisplayName= \"{displayName}\"";
if (user.Length > 0)
{
var obj = (domain.Length > 0) ? $"{domain}\\{user}" : user;
@@ -4,26 +4,23 @@

# Manual: readme.md, readme.eng.md

# required System service name, cannot be the same as an existing service in the system
ServiceName: An Easy Service
ServiceName: easy-service

DisplayName: An Easy Service

Description: An example of EasyService

# required Executable program and command line parameters
Worker: sample-worker.exe

# required
WorkingDir: worker
OutFileDir: outfiles

# optional
Description: An Simple Description

# optional
DisplayName: An Simple DisplayName
OutFileDir: outfiles

# encoding of the worker, i.e utf8|cp936|... , leave empty to use system's default encoding
WorkerEncoding: utf8

# user who you want to run this service, leave empty to use LOCAL-SYSTEM
# if using normal user, you must grant him the permission of running services at services management center
Domain:
User:
Password:
BIN +0 Bytes (100%) svc.exe
Binary file not shown.

0 comments on commit c3a472a

Please sign in to comment.
You can’t perform that action at this time.