From ae8a1d402dfea0650d0e7a55430092bb209504e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Wed, 22 Apr 2015 05:15:45 +0100 Subject: [PATCH] Added the FluentCommandLineParser.dll library to the project to easier get the passed parameters. https://github.com/fclp/fluent-command-line-parser Added a new argument 'Filename' (-f, /f, --filename): Set the path and/or filename for the generated report file. If the passed path is a directory the default filename will be appended to it. Absolute or relative paths are allowed Added a new argument 'Max Tasks' (-t, /t, --max-tasks ): Sets the maximum number of concurrent tasks enabled to generate the reports. If it is -1, there is no limit on the number of concurrently running operations (Default). If it is 1 it will run in a single thread, best used with single core CPUs or for debuging. Added a new argument 'Help' (-?, /?, --help): Display a help message with all possible arguments and its usages Added support for combined (grouped) options when passing three or more boolean arguments. ex: -sno (same as: -s -n -o) Changed the way arguments can be passed. Now it support the following syntax: [-|--|/][switch_name][=|:| ][value] Removed the empty columns for installed programs table under Mac OSX Removed 'Single Thread' argument in favor of the new 'Max Tasks' argument, use -t 1 to produce the same effect --- CHANGELOG.md | 14 + LICENSE.md | 374 ++++++++++++++++++ SystemInfoSnapshot/ApplicationArguments.cs | 115 ++++-- SystemInfoSnapshot/EmbeddedAssembly.cs | 2 +- SystemInfoSnapshot/FrmMain.cs | 6 +- SystemInfoSnapshot/HTMLTemplate.cs | 37 +- SystemInfoSnapshot/Program.cs | 51 ++- SystemInfoSnapshot/Properties/AssemblyInfo.cs | 5 +- SystemInfoSnapshot/Reports/Programs.cs | 29 +- SystemInfoSnapshot/Reports/Report.cs | 17 +- .../libraries/FluentCommandLineParser.dll | Bin 0 -> 41984 bytes SystemInfoSnapshot/SystemHelper.cs | 11 + SystemInfoSnapshot/SystemInfoSnapshot.csproj | 8 + 13 files changed, 601 insertions(+), 68 deletions(-) create mode 100644 LICENSE.md create mode 100644 SystemInfoSnapshot/Resources/libraries/FluentCommandLineParser.dll diff --git a/CHANGELOG.md b/CHANGELOG.md index 1032d23..c093343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +# v1.6.1.0 +## 22/04/2015 + +* Added the FluentCommandLineParser.dll library to the project to easier get the passed parameters. https://github.com/fclp/fluent-command-line-parser +* Added a new argument 'Filename' (-f, /f, --filename): Set the path and/or filename for the generated report file. If the passed path is a directory the default filename will be appended to it. Absolute or relative paths are allowed +* Added a new argument 'Max Tasks' (-t, /t, --max-tasks ): Sets the maximum number of concurrent tasks enabled to generate the reports. If it is -1, there is no limit on the number of concurrently running operations (Default). If it is 1 it will run in a single thread, best used with single core CPUs or for debuging. +* Added a new argument 'Help' (-?, /?, --help): Display a help message with all possible arguments and its usages +* Added support for combined (grouped) options when passing three or more boolean arguments. ex: -sno (same as: -s -n -o) +* Changed the way arguments can be passed. Now it support the following syntax: [-|--|/][switch_name][=|:| ][value] +* Removed the empty columns for installed programs table under Mac OSX +* Removed 'Single Thread' argument in favor of the new 'Max Tasks' argument, use -t 1 to produce the same effect + + # v1.6.0.0 ## 21/04/2015 @@ -9,6 +22,7 @@ * Fixed a critical bug under linux and OSX that cause the processes report to broke all the html when any process name is null * Changed the InstalledProgram class was been rewrited and moved into Core + # v1.5.0.0 ## 18/04/2015 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..930d7b0 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,374 @@ +Mozilla Public License 2.0 (MPL-2.0) +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" +means each individual or legal entity that creates, contributes to +the creation of, or owns Covered Software. + +1.2. "Contributor Version" +means the combination of the Contributions of others (if any) used +by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" +means Covered Software of a particular Contributor. + +1.4. "Covered Software" +means Source Code Form to which the initial Contributor has attached +the notice in Exhibit A, the Executable Form of such Source Code +Form, and Modifications of such Source Code Form, in each case +including portions thereof. + +1.5. "Incompatible With Secondary Licenses" +means + +(a) that the initial Contributor has attached the notice described +in Exhibit B to the Covered Software; or + +(b) that the Covered Software was made available under the terms of +version 1.1 or earlier of the License, but not also under the +terms of a Secondary License. + +1.6. "Executable Form" +means any form of the work other than Source Code Form. + +1.7. "Larger Work" +means a work that combines Covered Software with other material, in +a separate file or files, that is not Covered Software. + +1.8. "License" +means this document. + +1.9. "Licensable" +means having the right to grant, to the maximum extent possible, +whether at the time of the initial grant or subsequently, any and +all of the rights conveyed by this License. + +1.10. "Modifications" +means any of the following: + +(a) any file in Source Code Form that results from an addition to, +deletion from, or modification of the contents of Covered +Software; or + +(b) any new file in Source Code Form that contains any Covered +Software. + +1.11. "Patent Claims" of a Contributor +means any patent claim(s), including without limitation, method, +process, and apparatus claims, in any patent Licensable by such +Contributor that would be infringed, but for the grant of the +License, by the making, using, selling, offering for sale, having +made, import, or transfer of either its Contributions or its +Contributor Version. + +1.12. "Secondary License" +means either the GNU General Public License, Version 2.0, the GNU +Lesser General Public License, Version 2.1, the GNU Affero General +Public License, Version 3.0, or any later versions of those +licenses. + +1.13. "Source Code Form" +means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") +means an individual or a legal entity exercising rights under this +License. For legal entities, "You" includes any entity that +controls, is controlled by, or is under common control with You. For +purposes of this definition, "control" means (a) the power, direct +or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of more than +fifty percent (50%) of the outstanding shares or beneficial +ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) +Licensable by such Contributor to use, reproduce, make available, +modify, display, perform, distribute, and otherwise exploit its +Contributions, either on an unmodified basis, with Modifications, or +as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer +for sale, have made, import, and otherwise transfer either its +Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; +or + +(b) for infringements caused by: (i) Your and any other third party's +modifications of Covered Software, or (ii) the combination of its +Contributions with other software (except as part of its Contributor +Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of +its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code +Form, as described in Section 3.1, and You must inform recipients of +the Executable Form how they can obtain a copy of such Source Code +Form by reasonable means in a timely manner, at a charge no more +than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this +License, or sublicense it under different terms, provided that the +license for the Executable Form does not attempt to limit or alter +the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + +This Source Code Form is "Incompatible With Secondary Licenses", as +defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/SystemInfoSnapshot/ApplicationArguments.cs b/SystemInfoSnapshot/ApplicationArguments.cs index 6f7633c..d464cad 100644 --- a/SystemInfoSnapshot/ApplicationArguments.cs +++ b/SystemInfoSnapshot/ApplicationArguments.cs @@ -5,9 +5,8 @@ * http://systeminfosnapshot.com/ * https://github.com/sn4k3/SystemInfoSnapshot */ -using System; -using System.Collections.Generic; -using System.Linq; + +using Fclp; namespace SystemInfoSnapshot { @@ -17,75 +16,121 @@ namespace SystemInfoSnapshot public sealed class ApplicationArguments { #region Singleton - /// - /// A instance of this class - /// - private static ApplicationArguments _instance; - /// /// Gets the singleton instance of this class /// public static ApplicationArguments Instance { - get { return _instance ?? (_instance = new ApplicationArguments()); } + get { return CmdParser.Object; } } #endregion #region Properties + + /// + /// Gets the parameter parser + /// + public static FluentCommandLineParser CmdParser = new FluentCommandLineParser { IsCaseSensitive = false }; + + /// + /// Gets if program will lunch without the GUI. (Terminal only) + /// + public bool NoGUI + { + get + { + return Silent && Null; + } + } + /// /// Gets if Null mode as passed as argument. /// - public bool Null { get; private set; } + public bool Null { get; set; } /// /// Gets if Silent mode as passed as argument. /// - public bool Silent { get; private set; } + public bool Silent { get; set; } /// /// Gets if OpenReport mode as passed as argument. /// - public bool OpenReport { get; private set; } + public bool OpenReport { get; set; } /// /// Gets if the reports will be generated under a single thread. /// - public bool UseSingleThread { get; private set; } - #endregion + public int MaxDegreeOfParallelism { get; set; } - #region Arguments Variable /// - /// Variable - Arguments list + /// Gets the full or partial filename to save the report /// - public readonly Dictionary Arguments = new Dictionary - { - {"Null", new []{"-n", "/n", "--null"}}, - {"Silent", new []{"-s", "/s", "--silent"}}, - {"OpenReport", new []{"-o", "/o", "--open-report"}}, - {"UseSingleThread", new []{"-st", "/st", "--single-thread"}} - }; + public string Filename { get; set; } #endregion #region Constructor /// /// Constructor. Auto initalize arguments. /// - private ApplicationArguments() + public ApplicationArguments() { - var args = Environment.GetCommandLineArgs().ToList(); + } + #endregion - foreach (var argument in Arguments) + #region Methods + /// + /// Fix some paramters and define limits. + /// + public void Fix() + { + // Set to -1 if 0 or lower + if (MaxDegreeOfParallelism <= 0) { - foreach (var s in argument.Value) - { - if(!args.Contains(s)) - continue; - - var type = GetType(); - var prop = type.GetProperty(argument.Key); - prop.SetValue(this, true); - } + MaxDegreeOfParallelism = -1; } + + if (string.IsNullOrWhiteSpace(Filename)) + { + Filename = null; + } + } + #endregion + + #region Static methods + public static ICommandLineParserResult Init(string[] args) + { + CmdParser.SetupHelp("?", "help").Callback(SystemHelper.DisplayMessage); + CmdParser.Setup(arg => arg.Null). + As('n', "null"). + SetDefault(false). + WithDescription("Only generate the report without showing or doing anything. Good for scripts or tasks."); + + CmdParser.Setup(arg => arg.Silent). + As('s', "silent"). + SetDefault(false). + WithDescription("Run program without showing the GUI. After the report is generated that will be shown on explorer after completion."); + + CmdParser.Setup(arg => arg.OpenReport). + As('o', "open-report"). + SetDefault(false). + WithDescription("After the report is generated that will be opened automatically in the default browser."); + + CmdParser.Setup(arg => arg.MaxDegreeOfParallelism). + As('t', "max-tasks"). + SetDefault(-1). + WithDescription("Sets the maximum number of concurrent tasks enabled to generate the reports. If it is -1, there is no limit on the number of concurrently running operations (Default). " + + "If it is 1 it will run in a single thread, best used with single core CPUs or for debuging."); + + CmdParser.Setup(arg => arg.Filename). + As('f', "target"). + SetDefault(null). + WithDescription("Set the path and/or filename for the generated report file. If the passed path is a directory the default filename will be appended to it. Absolute or relative paths are allowed."); + + var result = CmdParser.Parse(args); + + return result; + } #endregion } diff --git a/SystemInfoSnapshot/EmbeddedAssembly.cs b/SystemInfoSnapshot/EmbeddedAssembly.cs index d8ba005..45c11b5 100644 --- a/SystemInfoSnapshot/EmbeddedAssembly.cs +++ b/SystemInfoSnapshot/EmbeddedAssembly.cs @@ -11,6 +11,7 @@ using System.Linq; using System.Reflection; using System.Security.Cryptography; +using System.Windows.Forms; namespace SystemInfoSnapshot { @@ -143,7 +144,6 @@ public static Assembly OnResolveAssembly(object sender, ResolveEventArgs e) // Get the Name of the AssemblyFile var assemblyName = new AssemblyName(e.Name); var dllName = assemblyName.Name + ".dll"; - // Load from Embedded Resources var resources = thisAssembly.GetManifestResourceNames().Where(s => s.EndsWith(dllName)); if (resources.Any()) diff --git a/SystemInfoSnapshot/FrmMain.cs b/SystemInfoSnapshot/FrmMain.cs index 591142f..4ecabf9 100644 --- a/SystemInfoSnapshot/FrmMain.cs +++ b/SystemInfoSnapshot/FrmMain.cs @@ -109,12 +109,12 @@ private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventA { ButtonsSetEnabled(true); var location = Path.GetDirectoryName(Program.HtmlTemplate.LastSaveFilePath); - if (string.IsNullOrEmpty(location)) + /*if (string.IsNullOrEmpty(location)) { location = Application.StartupPath; - } + }*/ lbFilename.Text = Path.GetFileName(Program.HtmlTemplate.LastSaveFilePath); - //lbLocation.Text = location; + lbLocation.Text = location; EndDateTime = DateTime.Now; tmClock.Stop(); lbStatus.Text = string.Format("Report completed in {0:0.##}s", (EndDateTime - StartDateTime).TotalSeconds); diff --git a/SystemInfoSnapshot/HTMLTemplate.cs b/SystemInfoSnapshot/HTMLTemplate.cs index f1a7423..2f9f234 100644 --- a/SystemInfoSnapshot/HTMLTemplate.cs +++ b/SystemInfoSnapshot/HTMLTemplate.cs @@ -59,12 +59,39 @@ public void WriteFromVar(string templateVar, string html) /// public void WriteToFile() { - var filename = Filename ?? "SystemInfoSnapshot"; - filename += string.Format("_{0}.html", DateTime.Now).Replace(':', '-').Replace('/', '-').Replace(' ', '_'); + var defaultFilename = string.Format("SystemInfoSnapshot_{0}.html", DateTime.Now). + Replace(':', '-'). + Replace('/', '-'). + Replace(' ', '_');; + var filename = Filename ?? defaultFilename; + + //filename += string.Format("_{0}.html", DateTime.Now).Replace(':', '-').Replace('/', '-').Replace(' ', '_'); #if !DEBUG - var path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); - - filename = Directory.Exists(path) ? Path.Combine(path, filename) : filename; + string path = null; + if (!string.IsNullOrEmpty(Filename)) + { + // If is a directory then keep filename the default name and set the folder only. + if (Directory.Exists(filename)) + { + path = filename; + filename = defaultFilename; + } + else // If is not a directory then get the path from the filename if any and append .html to the filename + { + path = Path.GetDirectoryName(Filename); + if (!filename.EndsWith(".html")) + filename += ".html"; + } + } + + // Last check for invalid path, if invalid set path as dekstop + if (string.IsNullOrEmpty(path) || !Directory.Exists(path)) + { + path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); + } + + + filename = !string.IsNullOrEmpty(path) && Directory.Exists(path) ? Path.Combine(path, filename) : filename; #endif using (var htmlWriter = new StreamWriter(filename)) { diff --git a/SystemInfoSnapshot/Program.cs b/SystemInfoSnapshot/Program.cs index c09cbbc..2a9ae7e 100644 --- a/SystemInfoSnapshot/Program.cs +++ b/SystemInfoSnapshot/Program.cs @@ -7,6 +7,7 @@ */ using System; +using System.Runtime.CompilerServices; using System.Windows.Forms; using SystemInfoSnapshot.Reports; @@ -14,20 +15,57 @@ namespace SystemInfoSnapshot { static class Program { + #region Properties + /// + /// Gets the project website + /// public const string Website = "http://systeminfosnapshot.com"; - public static HtmlTemplate HtmlTemplate; - public static Report[] Reports; + public static HtmlTemplate HtmlTemplate { get; private set; } + public static Report[] Reports { get; private set; } + #endregion + + #region Constructor + /// + /// Constructor + /// + static Program() + { + AppDomain.CurrentDomain.AssemblyResolve += EmbeddedAssembly.OnResolveAssembly; + } + #endregion + + #region Bootsrap /// /// The main entry point for the application. /// [STAThread] static void Main() { - AppDomain.CurrentDomain.AssemblyResolve += EmbeddedAssembly.OnResolveAssembly; + // Skip this method and do all work on a secondary method for .NET able to register embbeded assemblies correctly + MainCore(); + } + + /// + /// + /// + [MethodImpl(MethodImplOptions.NoInlining)] + static void MainCore() + { Reports = Report.GetReports(); + var resultArgs = ApplicationArguments.Init(Environment.GetCommandLineArgs()); + if (resultArgs.HasErrors) + { + SystemHelper.DisplayMessage(resultArgs.ErrorText); + } + if (resultArgs.HelpCalled) + { + // Quit + return; + } + ApplicationArguments.Instance.Fix(); // Null or Silent mode, skip GUI. - if (ApplicationArguments.Instance.Null || ApplicationArguments.Instance.Silent) + if (ApplicationArguments.Instance.NoGUI) { WriteTemplate(); return; @@ -37,13 +75,15 @@ static void Main() Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FrmMain()); } + #endregion + #region Static Methods /// /// Write all info into template and output the html file. /// public static void WriteTemplate() { - HtmlTemplate = Report.GenerateReports(Reports, true, ApplicationArguments.Instance.UseSingleThread); + HtmlTemplate = Report.GenerateReports(Reports, true, ApplicationArguments.Instance.Filename, ApplicationArguments.Instance.MaxDegreeOfParallelism); if (ApplicationArguments.Instance.Silent) { @@ -55,5 +95,6 @@ public static void WriteTemplate() HtmlTemplate.OpenInDefaultBrowser(); } } + #endregion } } diff --git a/SystemInfoSnapshot/Properties/AssemblyInfo.cs b/SystemInfoSnapshot/Properties/AssemblyInfo.cs index 9655512..c749720 100644 --- a/SystemInfoSnapshot/Properties/AssemblyInfo.cs +++ b/SystemInfoSnapshot/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -32,5 +31,5 @@ // 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.6.0.0")] -[assembly: AssemblyFileVersion("1.6.0.0")] +[assembly: AssemblyVersion("1.6.1.0")] +[assembly: AssemblyFileVersion("1.6.1.0")] diff --git a/SystemInfoSnapshot/Reports/Programs.cs b/SystemInfoSnapshot/Reports/Programs.cs index 517ff4d..fa80e81 100644 --- a/SystemInfoSnapshot/Reports/Programs.cs +++ b/SystemInfoSnapshot/Reports/Programs.cs @@ -27,9 +27,12 @@ protected override void Build() HtmlWriter.RenderTag(HtmlTextWriterTag.Th, "#"); HtmlWriter.RenderTag(HtmlTextWriterTag.Th, "Program"); - HtmlWriter.RenderTag(HtmlTextWriterTag.Th, "Version"); - HtmlWriter.RenderTag(HtmlTextWriterTag.Th, "Publisher"); - HtmlWriter.RenderTag(HtmlTextWriterTag.Th, SystemHelper.IsWindows ? "Install Date" : "Description"); + if (!SystemHelper.IsMacOSX) + { + HtmlWriter.RenderTag(HtmlTextWriterTag.Th, "Version"); + HtmlWriter.RenderTag(HtmlTextWriterTag.Th, "Publisher"); + HtmlWriter.RenderTag(HtmlTextWriterTag.Th, SystemHelper.IsWindows ? "Install Date" : "Description"); + } HtmlWriter.RenderEndTag(); // HtmlWriter.RenderEndTag(); // @@ -52,13 +55,21 @@ protected override void Build() HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "index", i.ToString()); HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "program", program.Name); - HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "version", program.Version); - HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "publisher", program.Publisher); - if(SystemHelper.IsWindows) - HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "installdate", program.InstallDate); - else - HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "description", program.Description); + if (!SystemHelper.IsMacOSX) + { + HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "version", program.Version); + HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "publisher", + program.Publisher); + + if (SystemHelper.IsWindows) + HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "installdate", + program.InstallDate); + else + HtmlWriter.RenderTag(HtmlTextWriterTag.Td, HtmlTextWriterAttribute.Class, "description", + program.Description); + + } HtmlWriter.RenderEndTag(); diff --git a/SystemInfoSnapshot/Reports/Report.cs b/SystemInfoSnapshot/Reports/Report.cs index 85c10d9..419e7f9 100644 --- a/SystemInfoSnapshot/Reports/Report.cs +++ b/SystemInfoSnapshot/Reports/Report.cs @@ -141,7 +141,7 @@ public static Report[] GetReports() Where(t => (t.IsClass) && (!t.IsAbstract) && - (String.Equals(t.Namespace, "SystemInfoSnapshot.Reports", StringComparison.Ordinal)) && + (string.Equals(t.Namespace, "SystemInfoSnapshot.Reports", StringComparison.Ordinal)) && (t.IsSubclassOf(typeof(Report))) ).ToArray(); @@ -159,11 +159,15 @@ public static Report[] GetReports() /// /// List of reports to generate. /// True for save reports in the html file. - /// True to generate the reports without parallel tasks + /// Sets the file full or relative path, if folder is given default name will be used in it. + /// Sets the maximum number of concurrent tasks enabled by this ParallelOptions instance. /// with the reports already written in the template. - public static HtmlTemplate GenerateReports(Report[] reports, bool saveReport = true, bool useSingleThread = false) + public static HtmlTemplate GenerateReports(Report[] reports, bool saveReport = true, string filename = null, int maxDegreeOfParallelism = -1) { - var htmlTemplate = new HtmlTemplate(); + var htmlTemplate = new HtmlTemplate() + { + Filename = filename + }; //List asyncReports = new List(); /*if (useSingleThread) @@ -182,10 +186,9 @@ public static HtmlTemplate GenerateReports(Report[] reports, bool saveReport = t else {*/ #if DEBUG - var options = new ParallelOptions { MaxDegreeOfParallelism = 1 }; -#else - var options = new ParallelOptions { MaxDegreeOfParallelism = useSingleThread ? 1 : -1 }; + maxDegreeOfParallelism = 1; #endif + var options = new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism }; Parallel.ForEach(reports, options, report => { Debug.WriteLine(report.GetTemplateVar()); diff --git a/SystemInfoSnapshot/Resources/libraries/FluentCommandLineParser.dll b/SystemInfoSnapshot/Resources/libraries/FluentCommandLineParser.dll new file mode 100644 index 0000000000000000000000000000000000000000..d3ab14acda377fc58a18efc6b8b5b6cca08de7d4 GIT binary patch literal 41984 zcmeIbdtg-6)i=D(nVBa^g$^B7%uk zs{{HyO z&2DK2$Slt@Y@!>$!Gk}MM*(8^?#7p`i{W7^yMc-Q{3J4j&zOfAFCiK(|7V|?WCeU4 zL4}tyvYY5icEaG#0iqCi70@dkEc-k6`-1E_C(T zuA3_Btg19*!T2#c%Yd7MAjlHkLS-ok7nOj#damZQ?S^6mU6sl1p z>6RfKjEtsNNjmQ~&ernO`O`C@S7Uj&U)OAt3?!R4v}@|nF^-3&wPs1R8Hc8Y+|T0N zQO{r;Zm&U<^7w#u(c{ChtUuC>&&AW@ECNI(%(R^2kjRV!TD5uV>A*|D>RWXary3DB zahPhEDGVN6@n%6=8HHui7nk5!c*rO|WN=Vn&{NGR2pH)0iXjLXQI{bI82K(kkXfd) z9y!WbrScTIdh{fV{)sxFict>f8!{p7i6gjbf>sva9e68PWyTkS zS6c`no2$llEwi>`D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dxr!#h1TRW~?@whUbqsg_xVOaE0VT#w-0<0I+RceSpi11R79 z9AZ4?QUjmw=jbWPYWxk`y!Q5!@eUlxU+g85^0(wH{j8E=jY{qRmyrKeL&EP+Q18I% zOGx50e<+{zPQZ8NZv0!SUZ&J%nwS5vfEBbHzfQ6OhrP>yHQ{J{G3X}11;F|9g!iw9 zvcECm{?>$n--}Qm&Qb-eX5cXoU;gzLKFM5wGdeyI<#RVazvNE^ajIrW`Sdgmc>Rv(==zi}tJnX?HbyUnpxW@vNdv#op$?JxV4e@a2}jTB zl(qv0u@b)^ zgx~wkSjuO(?eLm9d>?4TKnvVs{oK;)an9Y2{|NP-fP5FB?Ddi(r|p7|_-bZ7PJX+g zGn5yjJK;AzW$%zSjp4U?IR3bu*djjto`M*e3>d?8gG%d*FWcZ*&ire_`bRcH#f8y#KE~@V@|+kAqME literal 0 HcmV?d00001 diff --git a/SystemInfoSnapshot/SystemHelper.cs b/SystemInfoSnapshot/SystemHelper.cs index eafff7b..3109d8b 100644 --- a/SystemInfoSnapshot/SystemHelper.cs +++ b/SystemInfoSnapshot/SystemHelper.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; +using System.Windows.Forms; namespace SystemInfoSnapshot { @@ -248,6 +249,16 @@ public static void OpenLink(string address) // We don't want any surprises } } + + public static void DisplayMessage(string text) + { + //Debug.WriteLine(text); + Console.WriteLine(text); + if (IsWindows || IsMacOSX) + { + MessageBox.Show(text); + } + } #endregion } } \ No newline at end of file diff --git a/SystemInfoSnapshot/SystemInfoSnapshot.csproj b/SystemInfoSnapshot/SystemInfoSnapshot.csproj index c616a49..e137cf4 100644 --- a/SystemInfoSnapshot/SystemInfoSnapshot.csproj +++ b/SystemInfoSnapshot/SystemInfoSnapshot.csproj @@ -71,6 +71,10 @@ sign.pfx + + Resources\libraries\FluentCommandLineParser.dll + False + Resources\libraries\OpenHardwareMonitorLib.dll False @@ -147,6 +151,9 @@ CHANGELOG.md + + LICENSE.md + Makefile @@ -177,6 +184,7 @@ +