Skip to content

Commit

Permalink
Fix CLI crashing on launch in single file builds
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ authored May 24, 2024
1 parent 692f4e0 commit 0426380
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Il2CppInspector.CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright 2017-2021 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved.
Expand All @@ -9,17 +9,15 @@ All rights reserved.
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Xml.Schema;
using CommandLine;
using CommandLine.Text;
using Il2CppInspector.Cpp;
using Il2CppInspector.Cpp.UnityHeaders;
using Il2CppInspector.Model;
using Il2CppInspector.Outputs;
using Il2CppInspector.Reflection;
using Assembly = System.Reflection.Assembly;

namespace Il2CppInspector.CLI
{
Expand Down Expand Up @@ -176,7 +174,11 @@ private static int DisplayHelp(ParserResult<Options> result, IEnumerable<Error>
private static int Run(Options options) {

// Banner
var asmInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetEntryAssembly().Location);
var location = Assembly.GetEntryAssembly().Location;
if (location == "") // Single file executables don't have an assembly location
location = Path.Join(AppContext.BaseDirectory, "Il2CppInspector.exe");

var asmInfo = FileVersionInfo.GetVersionInfo(location);
Console.WriteLine(asmInfo.ProductName);
Console.WriteLine("Version " + asmInfo.ProductVersion);
Console.WriteLine(asmInfo.LegalCopyright);
Expand Down

0 comments on commit 0426380

Please sign in to comment.