diff --git a/outfiles/lastline.log b/outfiles/lastline.log index f9e298e..bcafd58 100644 --- a/outfiles/lastline.log +++ b/outfiles/lastline.log @@ -1 +1 @@ -[2019-11-28 18:27:02] Stopped SampleWorker(c# version) +[2019-12-04 17:04:53] Stopped SampleWorker(c# version) diff --git a/readme.md b/readme.md index 66c84f2..c7ed371 100644 --- a/readme.md +++ b/readme.md @@ -45,7 +45,7 @@ WorkingDir: worker # 输出目录,程序运行过程的输出将会写到这个目录下面,请确保该目录已存在 OutFileDir: outfiles -# 程序输出的编码,如果不确定,请设为空或 none +# 程序输出的编码,如果不确定,请设为空 WorkerEncoding: utf8 ``` diff --git a/src/Main.cs b/src/Main.cs index e099818..48e1f8f 100644 --- a/src/Main.cs +++ b/src/Main.cs @@ -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; diff --git a/svc.conf b/svc.conf index 708f6cb..8fa8106 100644 --- a/svc.conf +++ b/svc.conf @@ -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: \ No newline at end of file diff --git a/svc.exe b/svc.exe index b4e9331..88c8a6f 100644 Binary files a/svc.exe and b/svc.exe differ