From 39c72f98c11d6af6863a011d78e2a2ab054fb692 Mon Sep 17 00:00:00 2001 From: Guy Acosta Date: Tue, 21 Jan 2020 15:39:50 -0800 Subject: [PATCH] Resolves reported issue #75 for path issues when run outside of app directory on linux. Minor tag name improvement for C library use. --- AppInspector/AppInspector.csproj | 6 +++--- AppInspector/Properties/Resources.Designer.cs | 2 +- AppInspector/Properties/Resources.resx | 2 +- AppInspector/Utils.cs | 2 +- AppInspector/Writers/LiquidWriter.cs | 2 +- AppInspector/rules/default/components/load_dll.json | 2 +- AppInspector/rules/default/frameworks/c.json | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/AppInspector/AppInspector.csproj b/AppInspector/AppInspector.csproj index fd643415..44f8d22f 100644 --- a/AppInspector/AppInspector.csproj +++ b/AppInspector/AppInspector.csproj @@ -14,14 +14,14 @@ ApplicationInspector Application Inspector Microsoft - 1.0.20 + 1.0.21 AppInspector ApplicationInspector Microsoft.AppInspector.Program Microsoft true - 1.0.20.0 - 1.0.20.0 + 1.0.21.0 + 1.0.21.0 true diff --git a/AppInspector/Properties/Resources.Designer.cs b/AppInspector/Properties/Resources.Designer.cs index 08b62cf7..51cfc655 100644 --- a/AppInspector/Properties/Resources.Designer.cs +++ b/AppInspector/Properties/Resources.Designer.cs @@ -151,7 +151,7 @@ internal class Resources { } /// - /// Looks up a localized string similar to Unable to launch output.html. Set the BROWSER environment variable to your desired browser or open file manually.. + /// Looks up a localized string similar to Unable to launch output.html automatically. Set the BROWSER environment variable to your desired browser or launch your browser and navigate to the file to view the report file manually.. /// internal static string BROWSER_ENVIRONMENT_VAR { get { diff --git a/AppInspector/Properties/Resources.resx b/AppInspector/Properties/Resources.resx index b6e69c04..3fcb6265 100644 --- a/AppInspector/Properties/Resources.resx +++ b/AppInspector/Properties/Resources.resx @@ -148,7 +148,7 @@ unsupported - Unable to launch output.html. Set the BROWSER environment variable to your desired browser or open file manually. + Unable to launch output.html automatically. Set the BROWSER environment variable to your desired browser or launch your browser and navigate to the file to view the report file manually. Unable to launch output.html in default browser. Open manually to view report. diff --git a/AppInspector/Utils.cs b/AppInspector/Utils.cs index 886e1af4..69a3b295 100644 --- a/AppInspector/Utils.cs +++ b/AppInspector/Utils.cs @@ -46,7 +46,7 @@ static private string GetBaseAppPath() if (!String.IsNullOrEmpty(_basePath)) return _basePath; - _basePath = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory); + _basePath = Path.GetFullPath(System.AppContext.BaseDirectory); return _basePath; } diff --git a/AppInspector/Writers/LiquidWriter.cs b/AppInspector/Writers/LiquidWriter.cs index 1851bba0..7b8fbb68 100644 --- a/AppInspector/Writers/LiquidWriter.cs +++ b/AppInspector/Writers/LiquidWriter.cs @@ -21,7 +21,7 @@ public class LiquidWriter : Writer /// public override void WriteApp(AppProfile app) { - var htmlTemplateText = File.ReadAllText("html/index.html"); + var htmlTemplateText = File.ReadAllText(Path.Combine(Utils.GetPath(Utils.AppPath.basePath), "html/index.html")); Assembly test = Assembly.GetEntryAssembly(); Template.FileSystem = new EmbeddedFileSystem(Assembly.GetEntryAssembly(), "ApplicationInspector.html.partials"); diff --git a/AppInspector/rules/default/components/load_dll.json b/AppInspector/rules/default/components/load_dll.json index b803bb5e..c91e323e 100644 --- a/AppInspector/rules/default/components/load_dll.json +++ b/AppInspector/rules/default/components/load_dll.json @@ -24,7 +24,7 @@ "name": "Component: Windows DLL", "id": "AI005500", "description": "Component: Windows DLL", - "applies_to": [ "cpp" ], + "applies_to": [ "c", "cpp" ], "tags": [ "Component.Executable.Microsoft.DLL" ], diff --git a/AppInspector/rules/default/frameworks/c.json b/AppInspector/rules/default/frameworks/c.json index 6710f782..9e71e6bc 100644 --- a/AppInspector/rules/default/frameworks/c.json +++ b/AppInspector/rules/default/frameworks/c.json @@ -5,7 +5,7 @@ "description": "Development Framework: Standard C Library", "recommendation": "", "applies_to": [ "c" ], - "tags": [ "Framework.Development.StandardCLibrary" ], + "tags": [ "Framework.Development.Library.StandardC" ], "severity": "moderate", "patterns": [ { @@ -22,7 +22,7 @@ "description": "Development Framework: Boost", "recommendation": "", "applies_to": [ "c" ], - "tags": [ "Framework.Development.StandardCLibrary" ], + "tags": [ "Framework.Development.Library.Boost" ], "severity": "moderate", "patterns": [ {