From 05e83db38340db5d2d0131e0a4beaf43beec1d1f Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sun, 19 Jan 2020 04:08:20 +0100 Subject: [PATCH] Output: Give .sln file a default name when writing to root folder --- Il2CppDumper/Il2CppCSharpDumper.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Il2CppDumper/Il2CppCSharpDumper.cs b/Il2CppDumper/Il2CppCSharpDumper.cs index 6fe9a21..68ef99e 100644 --- a/Il2CppDumper/Il2CppCSharpDumper.cs +++ b/Il2CppDumper/Il2CppCSharpDumper.cs @@ -7,6 +7,7 @@ using System.ComponentModel; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices.ComTypes; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -133,7 +134,10 @@ namespace Il2CppInspector .Replace("%PROJECTDEFINITIONS%", slnProjectDefs.ToString()) .Replace("%PROJECTCONFIGURATIONS%", slnProjectConfigs.ToString()); - File.WriteAllText($"{outPath}\\{Path.GetFileName(outPath)}.sln", sln); + var filename = Path.GetFileName(outPath); + if (filename == "") + filename = "Il2CppProject"; + File.WriteAllText($"{outPath}\\{filename}.sln", sln); } private bool writeFile(string outFile, IEnumerable types, bool useNamespaceSyntax = true, bool outputAssemblyAttributes = true) {