Skip to content

Confusion about cross-platform support: Backend service seems hardcoded to `TissueLab_AI.exe #7

Open

Description

@cjjcn

Hello!

First of all, thank you so much for developing and maintaining the TissueLab_AI project!

I noticed that the README.md states that the project supports cross-platform execution (Windows, Linux, macOS).

However, I encountered an issue when trying to run the project in a Linux environment. To debug this, I looked into the Electron main process code, specifically the spawnBackendService function and the logic in the app.on('ready') event.

I found that this part of the code seems to hardcode the path to the Windows executable(in ./app/electron/main.js):

function spawnBackendService() {
  // This line is hardcoded to "windows/TissueLab_AI.exe"
  const backendServicePath = path.join(__dirname, '../service/dist/TissueLab_AI/windows/TissueLab_AI.exe');
  
  // This check will fail on Linux/macOS and prevent the service from starting
  if (!fssync.existsSync(backendServicePath)) {
    console.error(`[ELECTRON] Backend Service not found at: ${backendServicePath}`);
    // ...
    return false;
  };
  
  backendServiceProcess = spawn(backendServicePath, [], {stdio: 'inherit'});
  // ...
}

In the app.on('ready') event, this function is called, and on a Linux system, spawnBackendService() always returns false because it cannot find the .exe file.

My questions are:

  1. Does this mean that the backend service in the current version only supports Windows?

  2. If the project does support cross-platform, is there a different startup script I should be using, or am I expected to manually compile a Linux version of the backend service (e.g., a linux/TissueLab_AI binary)?

  3. Should the spawnBackendService function check the current operating system (e.g., using process.platform) and then dynamically decide which binary path to load?

Activity

  1. cjjcn commented on Nov 10, 2025

    @cjjcn
    Author

    Follow-up:

    I've been looking closer at the repository, and I've realized something that I'd like to clarify.

    The spawnBackendService function I mentioned, which directly launches the .exe, seems to be a Windows-only convenience method.

    However, I see that you have also provided the complete backend service source code (the Django project).

    This leads me to believe that for cross-platform development (on Linux/macOS), the intended workflow is to bypass Electron's service spawning entirely. Instead, I should manually run the backend service from its source code before I launch the Electron application.

    Could you please confirm if this is the correct and intended approach? If so, this would perfectly explain the cross-platform support mentioned in the README.

    Thanks again!

  2. Songhao-LI commented on Apr 3, 2026

    @Songhao-LI
    Contributor

    Hi @cjjcn ,

    Sorry for the late reply.

    Yes! The spawnBackendService is currently a Windows-only convenience that launches a prebuilt .exe, so it won’t work on Linux/macOS.
    For cross-platform usage, the intended workflow is to:

    • manually start the backend service (FastAPI) from source, and
    • then launch the Electron app separately

    So yes, bypassing spawnBackendService on Linux/macOS is the correct approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions