From 8031fe00c7093ec4b6753594df55edc85e4024d5 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 5 Feb 2014 14:27:31 -0800 Subject: Delete C# service... going C++, probably integrating with core. --- windows/ZeroTierOneService/App.config | 6 - windows/ZeroTierOneService/Program.cs | 25 ----- .../ZeroTierOneService/Properties/AssemblyInfo.cs | 36 ------ windows/ZeroTierOneService/Service.Designer.cs | 41 ------- windows/ZeroTierOneService/Service.cs | 110 ------------------ windows/ZeroTierOneService/Service.resx | 123 --------------------- .../ZeroTierOneService/ZeroTierOneService.csproj | 116 ------------------- 7 files changed, 457 deletions(-) delete mode 100644 windows/ZeroTierOneService/App.config delete mode 100644 windows/ZeroTierOneService/Program.cs delete mode 100644 windows/ZeroTierOneService/Properties/AssemblyInfo.cs delete mode 100644 windows/ZeroTierOneService/Service.Designer.cs delete mode 100644 windows/ZeroTierOneService/Service.cs delete mode 100644 windows/ZeroTierOneService/Service.resx delete mode 100644 windows/ZeroTierOneService/ZeroTierOneService.csproj (limited to 'windows/ZeroTierOneService') diff --git a/windows/ZeroTierOneService/App.config b/windows/ZeroTierOneService/App.config deleted file mode 100644 index 8e156463..00000000 --- a/windows/ZeroTierOneService/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/windows/ZeroTierOneService/Program.cs b/windows/ZeroTierOneService/Program.cs deleted file mode 100644 index b09884e5..00000000 --- a/windows/ZeroTierOneService/Program.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.ServiceProcess; -using System.Text; -using System.Threading.Tasks; - -namespace ZeroTierOneService -{ - static class Program - { - /// - /// The main entry point for the application. - /// - static void Main() - { - ServiceBase[] ServicesToRun; - ServicesToRun = new ServiceBase[] - { - new Service() - }; - ServiceBase.Run(ServicesToRun); - } - } -} diff --git a/windows/ZeroTierOneService/Properties/AssemblyInfo.cs b/windows/ZeroTierOneService/Properties/AssemblyInfo.cs deleted file mode 100644 index 058e8067..00000000 --- a/windows/ZeroTierOneService/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ZeroTierOneService")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ZeroTierOneService")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("540d1a89-f952-4927-a99a-cb0fb4d9d619")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/windows/ZeroTierOneService/Service.Designer.cs b/windows/ZeroTierOneService/Service.Designer.cs deleted file mode 100644 index 5fcf6d9c..00000000 --- a/windows/ZeroTierOneService/Service.Designer.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace ZeroTierOneService -{ - partial class Service - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // Service - // - this.ServiceName = "Service1"; - - } - - #endregion - - } -} diff --git a/windows/ZeroTierOneService/Service.cs b/windows/ZeroTierOneService/Service.cs deleted file mode 100644 index 306e8e4d..00000000 --- a/windows/ZeroTierOneService/Service.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.IO; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.ServiceProcess; -using System.Threading; - -namespace ZeroTierOneService -{ - public partial class Service : ServiceBase - { - public Service() - { - InitializeComponent(); - - this.ztHome = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + Path.DirectorySeparatorChar + "ZeroTier" + Path.DirectorySeparatorChar + "One"; - this.ztUpdatesFolder = this.ztHome + Path.DirectorySeparatorChar + "updates.d"; - this.ztBinary = this.ztHome + Path.DirectorySeparatorChar + (Environment.Is64BitOperatingSystem ? "zerotier-one_x64.exe" : "zerotier-one_x86.exe"); - - this.ztService = null; - this.ztKiller = null; - } - - protected override void OnStart(string[] args) - { - startZeroTierDaemon(); - } - - protected override void OnStop() - { - stopZeroTierDaemon(); - } - - private void startZeroTierDaemon() - { - if (ztService != null) - return; - ztService = new Process(); - try - { - ztService.StartInfo.UseShellExecute = false; - ztService.StartInfo.FileName = ztBinary; - ztService.StartInfo.Arguments = ""; - ztService.StartInfo.CreateNoWindow = true; - ztService.Exited += ztService_Exited; - ztService.Start(); - } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - ztService = null; - } - } - - private void stopZeroTierDaemon() - { - while (ztKiller != null) - Thread.Sleep(250); - - ztKiller = new Process(); - try - { - ztKiller.StartInfo.UseShellExecute = false; - ztKiller.StartInfo.FileName = ztBinary; - ztKiller.StartInfo.Arguments = "-q terminate ServiceShutdown"; - ztKiller.StartInfo.CreateNoWindow = true; - ztKiller.Exited += ztKiller_Exited; - ztKiller.Start(); - } - catch (Exception e) - { - ztKiller = null; - } - - int waited = 0; - while (ztKiller != null) - { - Thread.Sleep(250); - if (++waited > 100) - break; - } - - if (ztService != null) - { - ztService.Kill(); - ztService = null; - } - } - - // Event generated when ztService exits - private void ztService_Exited(object sender, System.EventArgs e) - { - ztService = null; - } - - // Event generated when ztKiller is done - private void ztKiller_Exited(object sender, System.EventArgs e) - { - ztKiller = null; - } - - private string ztHome; - private string ztUpdatesFolder; - private string ztBinary; - - private volatile Process ztService; - private volatile Process ztKiller; - } -} diff --git a/windows/ZeroTierOneService/Service.resx b/windows/ZeroTierOneService/Service.resx deleted file mode 100644 index e5858cc2..00000000 --- a/windows/ZeroTierOneService/Service.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - \ No newline at end of file diff --git a/windows/ZeroTierOneService/ZeroTierOneService.csproj b/windows/ZeroTierOneService/ZeroTierOneService.csproj deleted file mode 100644 index f409bbb8..00000000 --- a/windows/ZeroTierOneService/ZeroTierOneService.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - - Debug - AnyCPU - {63D28112-9A56-42FA-9C3E-EF6C58AF09B3} - WinExe - Properties - ZeroTierOneService - ZeroTierOneService - v4.5 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - ZeroTierOneService.Program - - - false - - - false - - - 5809BB3255B4F32DD93619C1CF26A7DF6C282A89 - - - - - - - - - - - - - - - Component - - - Service.cs - - - - - - - - - - Service.cs - - - - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - - - \ No newline at end of file -- cgit v1.2.3