Made service/console check more clear. Trying to create service without uninstaller.
parent
e5cb44e349
commit
a5063a0485
|
@ -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()
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue