From c802811ad298d20315e358b0fc7964a16e591aa6 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 7 Nov 2016 14:08:26 -0800 Subject: Added a file copy util for Windows UI Copies the authtoken.secret file into a private local folder for the user so that the UI doesnt have to be run with Admin privileges. --- windows/copyutil/App.config | 6 +++ windows/copyutil/Program.cs | 40 +++++++++++++++++++ windows/copyutil/Properties/AssemblyInfo.cs | 36 +++++++++++++++++ windows/copyutil/copyutil.csproj | 60 +++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 windows/copyutil/App.config create mode 100644 windows/copyutil/Program.cs create mode 100644 windows/copyutil/Properties/AssemblyInfo.cs create mode 100644 windows/copyutil/copyutil.csproj (limited to 'windows/copyutil') diff --git a/windows/copyutil/App.config b/windows/copyutil/App.config new file mode 100644 index 00000000..88fa4027 --- /dev/null +++ b/windows/copyutil/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/windows/copyutil/Program.cs b/windows/copyutil/Program.cs new file mode 100644 index 00000000..f65a5771 --- /dev/null +++ b/windows/copyutil/Program.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace copyutil +{ + class Program + { + static void Main(string[] args) + { + if (args.Length != 2) + { + Console.WriteLine("Not enough arguments"); + return; + } + + if (!Directory.Exists(args[0])) + { + Console.WriteLine("Source directory doesn't exist!"); + return; + } + + Console.WriteLine("Creating: " + args[1]); + DirectoryInfo di = Directory.CreateDirectory(args[1]); + + String authTokenSrc = args[0] + "\\authtoken.secret"; + String authTokenDest = args[1] + "\\authtoken.secret"; + + String portSrc = args[0] + "\\zerotier-one.port"; + String portDest = args[1] + "\\zerotier-one.port"; + + File.Copy(authTokenSrc, authTokenDest, true); + File.Copy(portSrc, portDest, true); + } + } +} + \ No newline at end of file diff --git a/windows/copyutil/Properties/AssemblyInfo.cs b/windows/copyutil/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..5c4c6466 --- /dev/null +++ b/windows/copyutil/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("copyutil")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("copyutil")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[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("6d27214a-087b-4484-b898-ad2a13fa3b9e")] + +// 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/copyutil/copyutil.csproj b/windows/copyutil/copyutil.csproj new file mode 100644 index 00000000..099208fd --- /dev/null +++ b/windows/copyutil/copyutil.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {6D27214A-087B-4484-B898-AD2A13FA3B9E} + Exe + Properties + copyutil + copyutil + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3