From c0719eb0f2ce56d9b393b76b603cd4900b937081 Mon Sep 17 00:00:00 2001 From: commonuserlol <111648021+commonuserlol@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:05:34 +0200 Subject: [PATCH] Program: Resolve ~ as user home (#407) Co-authored-by: commonuserlol --- Cpp2IL/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cpp2IL/Program.cs b/Cpp2IL/Program.cs index a93af49d..4abf2471 100644 --- a/Cpp2IL/Program.cs +++ b/Cpp2IL/Program.cs @@ -522,6 +522,8 @@ private static Cpp2IlRuntimeArgs GetRuntimeOptionsFromCommandLine(string[] comma if (options.ForcedBinaryPath == null) { + if (options.GamePath.StartsWith("~")) + options.GamePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + options.GamePath.Substring(1); ResolvePathsFromCommandLine(options.GamePath, options.ExeName, ref result); } else @@ -534,7 +536,7 @@ private static Cpp2IlRuntimeArgs GetRuntimeOptionsFromCommandLine(string[] comma if (result.UnityVersion.Type == UnityVersionType.Alpha && result.UnityVersion.Build == 0) //Map a0 to f1 - we assume the user simply didn't provide the final part of the version number result.UnityVersion = new UnityVersion(result.UnityVersion.Major, result.UnityVersion.Minor, result.UnityVersion.Build, UnityVersionType.Final, 1); - + result.Valid = true; }