Made service/console check more clear. Trying to create service without uninstaller.

surfaceProFixes
Sean McArde 2016-11-06 13:22:12 -08:00
parent e5cb44e349
commit a5063a0485
2 changed files with 13 additions and 5 deletions

View File

@ -90,6 +90,11 @@ USAGE
Run(new[] { this });
break;
case "/setupservice":
ServiceExecutionMode = ServiceExecutionMode.Install;
SetupService();
break;
case "/console":
ServiceExecutionMode = ServiceExecutionMode.Console;
Console.WriteLine("Starting Service...");
@ -173,6 +178,12 @@ USAGE
CreateUninstaller();
}
private void SetupService() {
GetInstaller(".InstallLog").Install(new Hashtable());
InstallServiceCommandLine();
CreateRegKeys();
}
internal abstract void CreateRegKeys();
private void InstallServiceCommandLine()

View File

@ -355,11 +355,8 @@ namespace WifiSitter
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 (ServiceExecutionMode != ServiceExecutionMode.Console &&
ServiceExecutionMode != ServiceExecutionMode.Service) return;
Intialize();