Skip to content

feat(nx): route PRT files to the one matching running NX without discarding working copies - #32

Merged
damos2020 merged 2 commits into
devfrom
feat/nx-session-router-safe-20261111
Nov 11, 2026
Merged

damos2020 merged 2 commits into
devfrom
feat/nx-session-router-safe-20261111

Conversation

@servicememeai

@servicememeai servicememeai commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

User problem

Already-deployed Windows 10/11 CloudFile Agent opens PRT files using directly spawned ugraf.exe -retrieve:<path>, causing a new NX window on each open. The direct -retrieve route was validated on real customer NX 7.5 machines and must be preserved as the no-running-session fallback.

Change

  • On Windows only, enumerate ugraf.exe using native ToolHelp APIs. Inspect the actual executable path via QueryFullProcessImageNameW without CMD, PowerShell, PATH or administrator privilege.
  • No existing NX: continue using the current proven ugraf.exe -retrieve:<file> launch, retaining NX7.x Unicode-path checks and detected version/working-directory rules.
  • Exactly one existing NX and identical actual executable path: if sibling ugs_router.exe is available, pass -ug -use_file_dir <file> as separate native argv. This is the known Siemens association command for activating existing NX sessions, but its success must still be validated in real NX. User-defined open rules retain precedence.
  • Multiple NX, inaccessible process path, different NX version or missing router: fail closed with guidance to open the working-copy file in the desired NX session. Do not start another ugraf.exe or guess at a Teamcenter session.
  • Record the actual running NX PID, not ephemeral router PID, with additive routed_nx in the existing opened.json (older records stay readable). Deleting a previously routed NX working copy requires explicit user confirmation even if the PID subsequently disappears. Existing file-lock check remains first, and no other files in the folder are removed.
  • Windows native API features are limited to the existing Windows-only crate, no new dependencies.

Test evidence

Gate before merge or publishing

Draft: not real Windows/NX verification. Must verify Win10 and Win11 ordinary-user workstations with NX7.5, NX12, NX2306+; absent/one/multiple sessions; managed Teamcenter; file route from Chrome, same-file repeat, local-view/edit, commit/upload and deletion protection. Correct result means the file actually appears in the existing NX session, not merely that ugs_router.exe exited 0. Do not merge or deploy on CI alone.

CI / Windows installer compatibility follow-up

  • Legacy Windows install.cmd and install.dev.cmd are explicitly GBK + CRLF (no BOM). Preserved both files and their trusted SHA-256 verification and download/installation control flow. Only added ASCII [WARN] / [ERROR] tags before existing Chinese messages, to make Windows CI fail-closed checks and support logs stable across Windows code pages.
  • .gitattributes now marks the -text CMD files as whitespace=cr-at-eol so git diff --check correctly accepts mandatory CRLF while still prohibiting Git encoding/newline conversion. Added small deterministic installer tests asserting the exact safety tags. No scripts are executed on live customer machines.
  • Recheck the latest Windows CI after this follow-up, keep Draft until actual Windows 10/11 unrestricted and enterprise-limited E2E verification.

@damos2020
damos2020 merged commit b099938 into dev Nov 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants