From 31550c1a1b75e14bec4264f6e75a2a2689cd8cd6 Mon Sep 17 00:00:00 2001 From: art0007i Date: Thu, 11 Sep 2025 14:03:49 +0200 Subject: [PATCH 1/2] add quotes around all arguments, to prevent args getting split incorrectly --- RenderiteHook/Plugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RenderiteHook/Plugin.cs b/RenderiteHook/Plugin.cs index 2ce03fb..aea8957 100644 --- a/RenderiteHook/Plugin.cs +++ b/RenderiteHook/Plugin.cs @@ -46,7 +46,7 @@ public static IEnumerable Transpiler(IEnumerable '"' + x + '"')]); Log.LogInfo($"Starting renderer with args: {newArgs}"); return newArgs; } From 2c6512f768698d21ad9b09c0c363f5124dfc9a98 Mon Sep 17 00:00:00 2001 From: hazre <37149950+hazre@users.noreply.github.com> Date: Thu, 11 Sep 2025 21:34:01 +0200 Subject: [PATCH 2/2] Switch out GetCommandLineArgs for Environment.CommandLine GetCommandLineArgs stripes out the quotations, which is what we trying to prevent --- RenderiteHook/Plugin.cs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/RenderiteHook/Plugin.cs b/RenderiteHook/Plugin.cs index d889432..5fc6d5c 100644 --- a/RenderiteHook/Plugin.cs +++ b/RenderiteHook/Plugin.cs @@ -47,11 +47,37 @@ public static IEnumerable Transpiler(IEnumerable '"' + x + '"')]); + + var originalArgs = GetOriginalCommandLineArgs(); + var newArgs = string.IsNullOrEmpty(originalArgs) ? args : args + " " + originalArgs; Log.LogInfo($"Starting renderer with args: {newArgs}"); return newArgs; } + private static string GetOriginalCommandLineArgs() + { + string str = Environment.CommandLine; + + if (str.StartsWith("\"") && str.Length > 1) + { + int ix = str.IndexOf("\"", 1); + if (ix != -1) + { + str = str.Substring(ix + 1).TrimStart(); + } + } + else + { + int ix = str.IndexOf(" "); + if (ix != -1) + { + str = str.Substring(ix + 1).TrimStart(); + } + } + + return str; + } + private static void CopyDoorstopFiles(RenderSystem renderSystem) { try