From 296527b7fabd977b4eccdcec466cf5254486e033 Mon Sep 17 00:00:00 2001 From: Roger Zander Date: Wed, 22 Jul 2020 17:45:41 +0200 Subject: [PATCH] Initial upload RZGet --- RZGet/App.config | 32 ++ RZGet/Download & Upgrade.ico | Bin 0 -> 17542 bytes RZGet/FodyWeavers.xml | 3 + RZGet/FodyWeavers.xsd | 111 ++++++ RZGet/Program.cs | 524 ++++++++++++++++++++++++++ RZGet/Properties/AssemblyInfo.cs | 36 ++ RZGet/Properties/Settings.Designer.cs | 55 +++ RZGet/Properties/Settings.settings | 18 + RZGet/Properties/app.manifest | 70 ++++ RZGet/RZGet.csproj | 166 ++++++++ RZGet/RZGet.sln | 31 ++ RZGet/appveyor.yml | 10 + RZGet/packages.config | 6 + 13 files changed, 1062 insertions(+) create mode 100644 RZGet/App.config create mode 100644 RZGet/Download & Upgrade.ico create mode 100644 RZGet/FodyWeavers.xml create mode 100644 RZGet/FodyWeavers.xsd create mode 100644 RZGet/Program.cs create mode 100644 RZGet/Properties/AssemblyInfo.cs create mode 100644 RZGet/Properties/Settings.Designer.cs create mode 100644 RZGet/Properties/Settings.settings create mode 100644 RZGet/Properties/app.manifest create mode 100644 RZGet/RZGet.csproj create mode 100644 RZGet/RZGet.sln create mode 100644 RZGet/appveyor.yml create mode 100644 RZGet/packages.config diff --git a/RZGet/App.config b/RZGet/App.config new file mode 100644 index 0000000..93426fa --- /dev/null +++ b/RZGet/App.config @@ -0,0 +1,32 @@ + + + + +
+ + + + + + + + + + + + + + + 0 + + + + + + + + False + + + + diff --git a/RZGet/Download & Upgrade.ico b/RZGet/Download & Upgrade.ico new file mode 100644 index 0000000000000000000000000000000000000000..059c21fe8cda9e43c13a96161c152380e44c34e2 GIT binary patch literal 17542 zcmeHucU)CR*X}kZvBeUNMn%P56Fv5>80=z=U_%irf{1_$VgVIU6dQIy!CtTzu%K8G z>>!8@1-nSEhg0@*pV>%)#>6D|{oe2Xarf`Hn7uc9W<6_W&6-(j){&$l($|toCGn~$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5fPK?Qb-=(JkJFxtCipFNQIjGxYVDFUKEWeb&#Y*XjYb@5@tsiB{dyA*g+y z45jU1V=oo-1i@uhDP)!D(;;zL9|v?|zDPvli>b)asW8kR;|qvy~hww-~vl_vPrA|1iUld;xMk5!vw{Upa69ox76sNKR3 z=@a`@O`V$5G}Q^UGZ&+Cnh*1Ge7P??it_YhBX65vz{pg*4Lg9?MFz;8S6ktAESRC8 zUC?>1(knV&xXC}F>bQ6E_2+%@aA0-a(B=V zm{r2hbG2R$3W3b>%WW5CmhRG|eTw_6=}%^bn7*E$WcHBpfSpZKo`)Sf9)0)xbol&S zQ+z&af#ys>+uY0lM^96n-Sdh%Ez;TuKC|65f5=7Syyw}O;TQL3Zmj=DD#~|7xtA+K zD$0FbQSR@Gai3R~?QNhzZl;_U34v;o3ie?}U-RK_UjKGKG}O3NNmG(R#d6g@x8G^q zq*jMfJzA6;)uVaIQO2s0h2gwvFBPd-(@^sd&PT-7R=J)Il**?VNl{IkHbr`J;+OX; z{6>5$D!(+BzD*m#Uuhh!j?SGsBQre}4;|{@fnx(@&G>XL@^E@hsGm1p3WnX+ zT(>Qh-`ZtoW+?Uax3(~*JsbL?){N6~J>~D1^xO-G_QW^hcX@dZQX@EX{d6n~DbEt4 zMvX#lc2<7<2SKRbG!oT*j`=JN9mX|faZyh!F3GrKY34%=$&c^SzA5YOv#UxyOWRc1 zwp6t1or3ng-Yf4m`X^$F^)&wGkk%r+6IBxX6t`Fd3Bw(=jh`(0L99k4avSd~)3e3c z7hKd;#=byaS|W6dYB8pej6*@t4;+)JDX3StEUL2} zT_w+5>l5$9`a3ZGDdS{manPr|1l+10=x?5pGiYq4vPM|V$ozbskY>&glV7=wvwY_n z8W`O(I`_&d&$m~PH?^LbS!Binjk5ka%vTq;o|UbvV>)_v^x + + \ No newline at end of file diff --git a/RZGet/FodyWeavers.xsd b/RZGet/FodyWeavers.xsd new file mode 100644 index 0000000..44a5374 --- /dev/null +++ b/RZGet/FodyWeavers.xsd @@ -0,0 +1,111 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/RZGet/Program.cs b/RZGet/Program.cs new file mode 100644 index 0000000..f8a4b01 --- /dev/null +++ b/RZGet/Program.cs @@ -0,0 +1,524 @@ +// +// RZUpdate (C) 2017 by Roger Zander +// This Tool is under MS-Pl License (http://ruckzuck.codeplex.com/license) +// + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.IO; +using RuckZuck.Base; +using RZUpdate; +using Newtonsoft.Json; + +namespace RZGet +{ + class Program + { + public static RZScan oScan; + public static RZUpdater oUpdate; + public static bool bRunning = true; + + static int Main(string[] args) + { + bool bError = false; + + //Get Proxy from IE + WebRequest.DefaultWebProxy = WebRequest.GetSystemWebProxy(); + + if (!string.IsNullOrEmpty(Properties.Settings.Default.Customerid)) + RZRestAPIv2.CustomerID = Properties.Settings.Default.Customerid; + + RZRestAPIv2.DisableBroadcast = Properties.Settings.Default.DisableBroadcast; + + List lArgs = args.ToList(); + if (lArgs.Contains("-?") | lArgs.Contains("/?") | lArgs.Count < 1) + { + Console.WriteLine("RuckZuck CommandLine Tool (c) 2020 by Roger Zander"); + Console.WriteLine("Install:"); + Console.WriteLine("Install a Software from Shortname : RZGet.exe install \"\"[;\"\"]"); + Console.WriteLine("Install a Software from JSON File : RZGet.exe install \"\"[;\"\"]"); + Console.WriteLine("Install a Sepcific Version : RZGet.exe install --name \"\" --vendor \"\" --version \"\""); + Console.WriteLine(""); + Console.WriteLine("Show:"); + Console.WriteLine("Show Metadata : RZGet.exe show \"\""); + Console.WriteLine("Show Metadata for a specific Version : RZGet.exe show --name \"\" --vendor \"\" --version \"\""); + Console.WriteLine(""); + Console.WriteLine("Search:"); + Console.WriteLine("Show Catalog JSON: RZGet.exe search"); + return 0; + } + + if(lArgs[0].ToLower() == "install") + { + if(lArgs.Contains("--name", StringComparer.CurrentCultureIgnoreCase) || lArgs.Contains("--vendor", StringComparer.CurrentCultureIgnoreCase) || lArgs.Contains("--version", StringComparer.CurrentCultureIgnoreCase)) + { + + try + { + RZUpdater oRZSW = new RZUpdater(); + string ProductName = lArgs[lArgs.FindIndex(t => t.IndexOf("--name", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + string Manufacturer = lArgs[lArgs.FindIndex(t => t.IndexOf("--vendor", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + + if(string.IsNullOrEmpty(Manufacturer)) + Manufacturer = lArgs[lArgs.FindIndex(t => t.IndexOf("--manufacturer", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + + string ProductVersion = lArgs[lArgs.FindIndex(t => t.IndexOf("--version", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + oRZSW.SoftwareUpdate = new SWUpdate(ProductName, ProductVersion, Manufacturer); + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.ProductName)) + { + Console.WriteLine("'" + ProductName + "' is NOT available in RuckZuck...!"); + return 99; + } + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + oRZSW.SoftwareUpdate.GetInstallType(); + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + Console.WriteLine("PreRequisites not valid for '" + oRZSW.SoftwareUpdate.SW.ShortName + "'...!"); + return 91; + } + } + + if (Install(oRZSW)) + return 0; + } + catch (Exception ex) + { + Console.WriteLine("Error: " + ex.Message); + return 1; + } + } + + foreach(string sArg in args.Skip(1)) + { + if (File.Exists(sArg)) + { + RZUpdater oRZSW = new RZUpdater(sArg); + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.ProductName)) + { + Console.WriteLine("'" + sArg + "' is NOT available in RuckZuck...!"); + bError = true; + continue; + } + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + oRZSW.SoftwareUpdate.GetInstallType(); + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + Console.WriteLine("PreRequisites not valid for '" + sArg + "'...!"); + bError = false; + continue; + } + } + + if (Install(oRZSW)) + continue; + } + else + { + try + { + RZUpdater oRZSW = new RZUpdater(); + oRZSW.SoftwareUpdate = new SWUpdate(sArg.Trim('"').Trim()); + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.ProductName)) + { + Console.WriteLine("'" + sArg + "' is NOT available in RuckZuck...!"); + bError = true; + continue; + } + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + oRZSW.SoftwareUpdate.GetInstallType(); + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + Console.WriteLine("PreRequisites not valid for '" + sArg + "'...!"); + bError = false; + continue; + } + } + + if (Install(oRZSW)) + continue; + } + catch (Exception ex) + { + Console.WriteLine("Error: " + ex.Message); + bError = true; + } + + } + } + + if (bError) + return 1; + else + return 0; + } + + //if (lArgs[0].ToLower() == "hash") + //{ + // Console.WriteLine("hash"); + // Console.WriteLine(string.Join(";", args.Skip(1))); + // return 0; + //} + + if (lArgs[0].ToLower() == "search") + { + + Console.WriteLine(JsonConvert.SerializeObject(RZRestAPIv2.GetCatalog(), Formatting.Indented).ToString()); + return 0; + } + + if (lArgs[0].ToLower() == "show") + { + if (lArgs.Contains("--name", StringComparer.CurrentCultureIgnoreCase) || lArgs.Contains("--vendor", StringComparer.CurrentCultureIgnoreCase) || lArgs.Contains("--version", StringComparer.CurrentCultureIgnoreCase)) + { + + try + { + RZUpdater oRZSW = new RZUpdater(); + string ProductName = lArgs[lArgs.FindIndex(t => t.IndexOf("--name", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + string Manufacturer = lArgs[lArgs.FindIndex(t => t.IndexOf("--vendor", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + + if (string.IsNullOrEmpty(Manufacturer)) + Manufacturer = lArgs[lArgs.FindIndex(t => t.IndexOf("--manufacturer", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + + string ProductVersion = lArgs[lArgs.FindIndex(t => t.IndexOf("--version", StringComparison.CurrentCultureIgnoreCase) >= 0) + 1]; + oRZSW.SoftwareUpdate = new SWUpdate(ProductName, ProductVersion, Manufacturer); + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.ProductName)) + { + Console.WriteLine("'" + ProductName + "' is NOT available in RuckZuck...!"); + return 99; + } + + Console.WriteLine(JsonConvert.SerializeObject(oRZSW.SoftwareUpdate.SW, Formatting.Indented).ToString()); + + return 0; + } + catch (Exception ex) + { + Console.WriteLine("Error: " + ex.Message); + return 1; + } + } + + foreach (string sArg in args.Skip(1)) + { + if (File.Exists(sArg)) + { + RZUpdater oRZSW = new RZUpdater(sArg); + + Console.WriteLine(JsonConvert.SerializeObject(oRZSW.SoftwareUpdate.SW, Formatting.Indented).ToString()); + } + else + { + try + { + RZUpdater oRZSW = new RZUpdater(); + oRZSW.SoftwareUpdate = new SWUpdate(sArg.Trim('"').Trim()); + + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.ProductName)) + { + Console.WriteLine("'" + sArg + "' is NOT available in RuckZuck...!"); + bError = true; + continue; + } + + Console.WriteLine(JsonConvert.SerializeObject(oRZSW.SoftwareUpdate.SW, Formatting.Indented).ToString()); + + return 0; + } + catch (Exception ex) + { + Console.WriteLine("Error: " + ex.Message); + return 1; + } + + } + } + + return 0; + } + + //if (lArgs[0].ToLower() == "source") + //{ + // Console.WriteLine("source"); + // Console.WriteLine(string.Join(";", args.Skip(1))); + // return 0; + //} + + //if (lArgs[0].ToLower() == "validate") + //{ + // Console.WriteLine("validate"); + // Console.WriteLine(string.Join(";", args.Skip(1))); + // return 0; + //} + + //if (lArgs.Count == 1) + //{ + // if (File.Exists(lArgs[0])) + // { + // RZUpdater oRZSW = new RZUpdater(lArgs[0]); + + // Console.WriteLine(oRZSW.SoftwareUpdate.SW.ProductName + " " + oRZSW.SoftwareUpdate.SW.ProductVersion + " :"); + // Console.Write("Downloading..."); + // if (oRZSW.SoftwareUpdate.Download().Result) + // { + // Console.WriteLine("... done."); + // Console.Write("Installing..."); + // if (oRZSW.SoftwareUpdate.Install(false,true).Result) + // { + // Console.WriteLine("... done."); + // } + // else + // { + // Console.WriteLine("... Error. The installation failed."); + // } + // } + // } + // else + // { + // if (lArgs[0].ToLower() == "/update" | lArgs[0].ToLower() == "-update") + // { + // oUpdate = new RZUpdater(); + // oScan = new RZScan(true, true); + // Console.Write("Detecting updates..."); + // oScan.OnUpdScanCompleted += OScan_OnUpdScanCompleted; + + // while (bRunning) + // { + // System.Threading.Thread.Sleep(100); + // } + // } + // else + // { + // foreach (string sArg in lArgs[0].Split(';')) + // { + // try + // { + // RZUpdater oRZSW = new RZUpdater(); + // oRZSW.SoftwareUpdate = new SWUpdate(sArg.Trim('"').Trim()); + + // if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.ProductName)) + // { + // Console.WriteLine("'" + sArg + "' is NOT available in RuckZuck...!"); + // bError = true; + // continue; + // } + // Console.WriteLine("PS:" + oRZSW.SoftwareUpdate.SW.PSInstall); + // if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + // { + // oRZSW.SoftwareUpdate.GetInstallType(); + // if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + // { + // Console.WriteLine("PreRequisites not valid for '" + sArg + "'...!"); + // bError = false; + // continue; + // } + // } + + + // Console.WriteLine(oRZSW.SoftwareUpdate.SW.Manufacturer + " " + oRZSW.SoftwareUpdate.SW.ProductName + " " + oRZSW.SoftwareUpdate.SW.ProductVersion); + // Console.Write("Downloading..."); + // foreach (string sPreReq in oRZSW.SoftwareUpdate.SW.PreRequisites) + // { + // if (!string.IsNullOrEmpty(sPreReq)) + // { + // RZUpdater oRZSWPreReq = new RZUpdater(); + // oRZSWPreReq.SoftwareUpdate = new SWUpdate(sPreReq); + // Console.WriteLine(); + // Console.Write("\tDownloading dependencies (" + oRZSWPreReq.SoftwareUpdate.SW.ShortName + ")..."); + // if (oRZSWPreReq.SoftwareUpdate.Download().Result) + // { + // Console.WriteLine("... done."); + // Console.Write("\tInstalling dependencies (" + oRZSWPreReq.SoftwareUpdate.SW.ShortName + ")..."); + // if (oRZSWPreReq.SoftwareUpdate.Install(false, true).Result) + // { + // Console.WriteLine("... done."); + // } + // else + // { + // Console.WriteLine("... Error. The installation failed."); + // bError = true; + // } + // } + // } + + // } + // if (oRZSW.SoftwareUpdate.Download().Result) + // { + // Console.WriteLine("... done."); + // Console.Write("Installing..."); + // if (oRZSW.SoftwareUpdate.Install(false, true).Result) + // { + // Console.WriteLine("... done."); + // } + // else + // { + // Console.WriteLine("... Error. The installation failed."); + // bError = true; + // } + // } + // } + // catch (Exception ex) + // { + // Console.WriteLine("Error: " + ex.Message); + // bError = true; + // } + // } + + + // } + // } + //} + + //if (lArgs.Count == 3) + //{ + // RZUpdater oRZUpdate = new RZUpdater(); + // oRZUpdate.SoftwareUpdate = new SWUpdate(lArgs[0], lArgs[1], lArgs[2]); + // if (oRZUpdate.SoftwareUpdate != null) + // { + // Console.WriteLine("New Version: " + oRZUpdate.SoftwareUpdate.SW.ProductVersion); + // Console.Write("Downloading..."); + + // if (oRZUpdate.SoftwareUpdate.Download().Result) + // { + // Console.WriteLine("... done."); + // Console.Write("Installing..."); + // if (oRZUpdate.SoftwareUpdate.Install(false, true).Result) + // { + // Console.WriteLine("... done."); + // return 0; + // } + // else + // { + // Console.WriteLine("... Error. The update installation failed."); + // return 1; + // } + // } + + // return 99; + // } + // else + // { + // Console.WriteLine("No Update found..."); + // return 0; + // } + //} + + //System.Threading.Thread.Sleep(500); + //if(bError) + // return 2; + + return 0; + } + + private static bool Install(RZUpdater oRZSW) + { + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + oRZSW.SoftwareUpdate.GetInstallType(); + if (string.IsNullOrEmpty(oRZSW.SoftwareUpdate.SW.PSInstall)) + { + Console.WriteLine("PreRequisites not valid for '" + oRZSW.SoftwareUpdate.SW.ShortName + "'...!"); + return false; + } + } + + + Console.WriteLine(oRZSW.SoftwareUpdate.SW.Manufacturer + " " + oRZSW.SoftwareUpdate.SW.ProductName + " " + oRZSW.SoftwareUpdate.SW.ProductVersion); + Console.Write("Downloading..."); + foreach (string sPreReq in oRZSW.SoftwareUpdate.SW.PreRequisites) + { + if (!string.IsNullOrEmpty(sPreReq)) + { + RZUpdater oRZSWPreReq = new RZUpdater(); + oRZSWPreReq.SoftwareUpdate = new SWUpdate(sPreReq); + Console.WriteLine(); + Console.Write("\tDownloading dependencies (" + oRZSWPreReq.SoftwareUpdate.SW.ShortName + ")..."); + if (oRZSWPreReq.SoftwareUpdate.Download().Result) + { + Console.WriteLine("... done."); + Console.Write("\tInstalling dependencies (" + oRZSWPreReq.SoftwareUpdate.SW.ShortName + ")..."); + if (oRZSWPreReq.SoftwareUpdate.Install(false, true).Result) + { + Console.WriteLine("... done."); + } + else + { + Console.WriteLine("... Error. The installation failed."); + return false; + } + } + } + + } + if (oRZSW.SoftwareUpdate.Download().Result) + { + Console.WriteLine("... done."); + Console.Write("Installing..."); + if (oRZSW.SoftwareUpdate.Install(false, true).Result) + { + Console.WriteLine("... done."); + return true; + } + else + { + Console.WriteLine("... Error. The installation failed."); + return false; + } + } + + return false; + } + + private static void OScan_OnUpdScanCompleted(object sender, EventArgs e) + { + Console.WriteLine("... done."); + Console.WriteLine(oScan.NewSoftwareVersions.Count + " updates found."); + + foreach (AddSoftware oSW in oScan.NewSoftwareVersions) + { + try + { + if (Properties.Settings.Default.Excludes.Cast().ToList().FirstOrDefault(t => t.ToLower() == oSW.ShortName.ToLower()) != null) + { + Console.WriteLine("Skipping: " + oSW.ShortName + " (excluded)"); + continue; + } + Console.WriteLine(oSW.Manufacturer + " " + oSW.ProductName + " new Version: " + oSW.ProductVersion); + oUpdate.SoftwareUpdate.SW = oSW; + oUpdate.SoftwareUpdate.GetInstallType(); + Console.Write("Downloading..."); + if (oUpdate.SoftwareUpdate.Download().Result) + { + Console.WriteLine("... done."); + Console.Write("Installing..."); + if (oUpdate.SoftwareUpdate.Install(false, true).Result) + { + Console.WriteLine("... done."); + } + else + { + Console.WriteLine("... Error. The update installation failed."); + } + } + } + catch(Exception ex) + { + Console.WriteLine("E131:" + ex.Message); + } + } + bRunning = false; + } + } +} diff --git a/RZGet/Properties/AssemblyInfo.cs b/RZGet/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c7eb5f7 --- /dev/null +++ b/RZGet/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("RuckZuck Updater")] +[assembly: AssemblyDescription("RuckZuck Command-Line Tool")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Zander Tools")] +[assembly: AssemblyProduct("RZGet")] +[assembly: AssemblyCopyright("Copyright © 2020 by Roger Zander")] +[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("a371ce98-eb0a-4e65-9ae5-4d1057cae3d1")] + +// 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.7.1.*")] +[assembly: AssemblyFileVersion("1.7.1.5")] diff --git a/RZGet/Properties/Settings.Designer.cs b/RZGet/Properties/Settings.Designer.cs new file mode 100644 index 0000000..4d90acc --- /dev/null +++ b/RZGet/Properties/Settings.Designer.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace RZGet.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n 0\r\n")] + public global::System.Collections.Specialized.StringCollection Excludes { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["Excludes"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Customerid { + get { + return ((string)(this["Customerid"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool DisableBroadcast { + get { + return ((bool)(this["DisableBroadcast"])); + } + } + } +} diff --git a/RZGet/Properties/Settings.settings b/RZGet/Properties/Settings.settings new file mode 100644 index 0000000..e28937b --- /dev/null +++ b/RZGet/Properties/Settings.settings @@ -0,0 +1,18 @@ + + + + + + <?xml version="1.0" encoding="utf-16"?> +<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <string>0</string> +</ArrayOfString> + + + + + + False + + + \ No newline at end of file diff --git a/RZGet/Properties/app.manifest b/RZGet/Properties/app.manifest new file mode 100644 index 0000000..634a10b --- /dev/null +++ b/RZGet/Properties/app.manifest @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RZGet/RZGet.csproj b/RZGet/RZGet.csproj new file mode 100644 index 0000000..af14865 --- /dev/null +++ b/RZGet/RZGet.csproj @@ -0,0 +1,166 @@ + + + + + + Debug + AnyCPU + {55349D55-7307-4E34-B544-91A49EB1BCAB} + Exe + Properties + RZGet + RZGet + v4.8 + 512 + SAK + SAK + SAK + SAK + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + 8.0 + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + false + Off + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + Download & Upgrade.ico + + + Custom + + + false + + + Properties\app.manifest + + + RZGet.Program + + + + packages\Costura.Fody.4.1.0\lib\net40\Costura.dll + + + packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + False + C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + + + + + + + + + + + + RZRestAPIv2.cs + + + RZScan.cs + + + RZUpdate.cs + + + + + True + True + Settings.settings + + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + if "$(ConfigurationName)"=="Debug" GOTO end + "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\Bin\SignTool.exe" sign /i "COMODO RSA Code Signing CA" /n "Roger Zander" /t "http://timestamp.comodoca.com/authenticode" /q "$(TargetPath)" +:end + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/RZGet/RZGet.sln b/RZGet/RZGet.sln new file mode 100644 index 0000000..03512e4 --- /dev/null +++ b/RZGet/RZGet.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30225.117 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RZGet", "RZGet.csproj", "{55349D55-7307-4E34-B544-91A49EB1BCAB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RZUpdateTest", "..\RZUpdateTest\RZUpdateTest.csproj", "{5DEC3776-C81E-4C63-AE90-675E686A033C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {55349D55-7307-4E34-B544-91A49EB1BCAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55349D55-7307-4E34-B544-91A49EB1BCAB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55349D55-7307-4E34-B544-91A49EB1BCAB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55349D55-7307-4E34-B544-91A49EB1BCAB}.Release|Any CPU.Build.0 = Release|Any CPU + {5DEC3776-C81E-4C63-AE90-675E686A033C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5DEC3776-C81E-4C63-AE90-675E686A033C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5DEC3776-C81E-4C63-AE90-675E686A033C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5DEC3776-C81E-4C63-AE90-675E686A033C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5036A53A-858A-4C09-8D0F-7CB9ED006A50} + EndGlobalSection +EndGlobal diff --git a/RZGet/appveyor.yml b/RZGet/appveyor.yml new file mode 100644 index 0000000..c779fc4 --- /dev/null +++ b/RZGet/appveyor.yml @@ -0,0 +1,10 @@ +version: 1.6.1.{build} +skip_tags: true +image: Visual Studio 2017 +before_build: +- ps: nuget restore RZUpdate\RZUpdate.sln +build: + project: /RZUpdate/RZUpdate.sln + verbosity: minimal +artifacts: +- path: RZUpdate\bin\Debug\RZUpdate.exe \ No newline at end of file diff --git a/RZGet/packages.config b/RZGet/packages.config new file mode 100644 index 0000000..3fab4db --- /dev/null +++ b/RZGet/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file