refactor: resolve launcher paths and isolate batch automation

This commit is contained in:
codex
2026-08-04 11:48:30 +03:00
parent ea6f3cdcdf
commit e13f44ac3c
11 changed files with 404 additions and 44 deletions
+3 -3
View File
@@ -16,12 +16,12 @@ public sealed class StartupScriptBuilder : IStartupScriptBuilder
{
public string BuildNetloadScript(string root, string entry)
{ var full = Path.GetFullPath(Path.Combine(root, entry)); if (!full.StartsWith(Path.GetFullPath(root) + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) || !File.Exists(full)) throw new InvalidOperationException("UNTRUSTED_ENTRY_PATH"); return $"_.NETLOAD\n\"{full.Replace("\"", "\\\"")}\"\n"; }
public string BuildAutomationScript(string root, string entry, string fixtureOrthoDwg)
public string BuildAutomationScript(ResolvedAutomationScriptPaths paths)
{
var fixture = Path.GetFullPath(fixtureOrthoDwg);
var fixture = Path.GetFullPath(paths.FixtureOrthoDwg);
if (!File.Exists(fixture)) throw new InvalidOperationException("AUTOMATION_FIXTURE_NOT_FOUND");
var quote = (string value) => "\"" + value.Replace("\"", "\\\"") + "\"";
return "_.OPEN\n" + quote(fixture) + "\n" + BuildNetloadScript(root, entry) +
return "_.OPEN\n" + quote(fixture) + "\n" + BuildNetloadScript(paths.ValidatedPackageRoot, paths.EntryAssembly) +
"PHP_REC_AUTOMATION_PREPARE\nPXP-OA\nPXP-OA\nPHP_REC_AUTOMATION_FINALIZE\n";
}
}