ModelHandle/tools/step_service/PORTABLE_RUNTIME.md
sladro 16a2e43649
Some checks failed
Build / build (18.x, macos-latest) (push) Has been cancelled
Build / build (18.x, ubuntu-latest) (push) Has been cancelled
Build / build (18.x, windows-latest) (push) Has been cancelled
Build / build (20.x, macos-latest) (push) Has been cancelled
Build / build (20.x, ubuntu-latest) (push) Has been cancelled
Build / build (20.x, windows-latest) (push) Has been cancelled
fix step save flow and add portable backend runtime support
2026-04-13 15:16:30 +08:00

1.4 KiB

Portable STEP Service Runtime

Goal

Run the STEP save backend from this project folder on another Windows machine without installing system Python or system FreeCAD.

Expected layout

Put these runtimes inside the project root:

Online3DViewer/
  runtime/
    python/
      python.exe
      ...
    freecad/
      bin/
        FreeCADCmd.exe
      ...

One-time setup on the source machine

  1. Copy a full Windows Python runtime into runtime/python.
  2. Copy the FreeCAD folder into runtime/freecad.
  3. Install backend dependencies into the portable Python:
tools\step_service\setup_portable_python.bat

Start the backend

Use the portable launcher:

tools\step_service\start_portable_server.bat

This launcher only uses runtime/python/python.exe. It does not modify system PATH.

How FreeCAD is resolved

The backend now checks FreeCAD in this order:

  1. runtime/freecad/bin/FreeCADCmd.exe
  2. FreeCADCmd from the current environment

So your existing local setup still works, but the portable folder takes priority when present.

Notes

  • Copy the whole project folder to the target machine.
  • The target machine still needs normal Windows runtime support that FreeCAD and Python depend on.
  • If you want zero manual commands on the target machine, use start_portable_server.bat instead of python tools/step_service/server.py.