Now logs start up failures to event viewer, debugging service start nearly impossible otherwise. Also checking array size before indexing into it.

surfaceProFixes
Sean McArde 2016-11-03 21:21:25 -07:00
parent 6514a78df6
commit e5cb44e349
1 changed files with 16 additions and 9 deletions

View File

@ -354,17 +354,24 @@ namespace WifiSitter
#region overrides
protected override void OnStartImpl(string[] args) {
try {
if (args == null) return;
if (args.Length > 0) {
if (args[0].ToLower() == "/install" ||
args[0].ToLower() == "/uninstall") return;
}
if (args == null) return;
if (args[0].ToLower() == "/install" ||
args[0].ToLower() == "/uninstall") return;
Intialize();
Intialize();
_thread = new Thread(WorkerThreadFunc);
_thread.Name = "WifiSitter Main Loop";
_thread.IsBackground = true;
_thread.Start();
_thread = new Thread(WorkerThreadFunc);
_thread.Name = "WifiSitter Main Loop";
_thread.IsBackground = true;
_thread.Start();
}
catch (Exception e) {
WriteLog(LogType.error, e.Source, e.Message);
}
}
protected override void OnStopImpl() {