diff --git a/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs b/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs index 12ab4b2..19b2db4 100644 --- a/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs +++ b/RecodeItLib/CrossCompiler/ReCodeItCrossCompiler.cs @@ -34,12 +34,6 @@ public class ReCodeItCrossCompiler return; } - if (ActiveProject.VisualStudioClonedSolutionDirectory == string.Empty) - { - Logger.Log("ERROR: No ReCodeIt Project directory is set. (Project Creation Failed)", ConsoleColor.Red); - return; - } - Remapper.InitializeRemap( ActiveProject.RemapModels, ActiveProject.OriginalAssemblyPath, @@ -66,7 +60,7 @@ public class ReCodeItCrossCompiler Logger.Log("Loading Solution...", ConsoleColor.Yellow); - var solution = await Task.Run(() => LoadSolutionAsync(workspace, ActiveProject.VisualStudioClonedSolutionPath)); + var solution = await Task.Run(() => LoadSolutionAsync(workspace, ActiveProject.VisualStudioSolutionPath)); Project newProject; diff --git a/RecodeItLib/Models/CrossCompilerProjectModel.cs b/RecodeItLib/Models/CrossCompilerProjectModel.cs index b48e440..bee5090 100644 --- a/RecodeItLib/Models/CrossCompilerProjectModel.cs +++ b/RecodeItLib/Models/CrossCompilerProjectModel.cs @@ -1,6 +1,4 @@ -using ReCodeIt.Utils; - -namespace ReCodeIt.Models; +namespace ReCodeIt.Models; public class CrossCompilerProjectModel { @@ -42,40 +40,14 @@ public class CrossCompilerProjectModel /// public string VisualStudioSolutionDirectoryPath => Path.GetDirectoryName(VisualStudioSolutionPath)!; - /// - /// The path the the cloned solution - /// - public string VisualStudioClonedSolutionPath => Path.Combine( - DataProvider.ReCodeItProjectsPath, - SolutionName, - SolutionName + ".sln"); - - public string VisualStudioClonedSolutionDirectory => Path.Combine( - DataProvider.ReCodeItProjectsPath, - SolutionName); - - /// - /// The path to the cloned solutions dependency folder - /// - public string VisualStudioClonedDependencyPath - { - get - { - // Take just the folder name - var folderName = VisualStudioDependencyPath.Split('\\').Last(); - - return Path.Combine(VisualStudioClonedSolutionDirectory, folderName); - } - } - - public string ProjectDllName => SolutionName + ".dll"; + public string ProjectDllName => SolutionName.Replace(".sln", ".dll"); public string OriginalAssemblyDllName => Path.GetFileName(OriginalAssemblyPath); /// /// Name of the solution /// - public string SolutionName { get; set; } + public string SolutionName => Path.GetFileName(VisualStudioSolutionPath); /// /// Remapped output hash diff --git a/RecodeItLib/Utils/DataProvider.cs b/RecodeItLib/Utils/DataProvider.cs index f2b719a..a3fd5fe 100644 --- a/RecodeItLib/Utils/DataProvider.cs +++ b/RecodeItLib/Utils/DataProvider.cs @@ -20,7 +20,7 @@ public static class DataProvider /// public static bool IsCli { get; set; } = false; - public static string DataPath => RegistryHelper.GetRegistryValue("DataPath"); + public static string DataPath => RegistryHelper.GetRegistryValue("DataPath") ?? Path.Combine(AppContext.BaseDirectory, "Data"); public static readonly string ReCodeItProjectsPath = Path.Combine(AppContext.BaseDirectory, "Projects"); @@ -32,12 +32,8 @@ public static class DataProvider public static AssemblyDefinition AssemblyDefinition { get; private set; } - public static AssemblyDefinition NameMangledAssemblyDefinition { get; private set; } - public static ModuleDefinition ModuleDefinition { get; private set; } - public static ModuleDefinition NameMangledModuleDefinition { get; private set; } - public static void LoadAppSettings() { var settingsPath = Path.Combine(DataPath, "Settings.jsonc");