Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Flow Launcher required absolute paths for Python and Node.js executables, breaking portability when the application is moved. Embedded runtimes within the portable directory structure were not supported.

Implementation

Core utilities (Constant.cs):

  • ResolveAbsolutePath(): Resolves relative paths to absolute at runtime, based on ProgramDirectory
  • ConvertToRelativePathIfPossible(): Auto-converts absolute paths within ProgramDirectory to relative format for storage

Plugin environment (AbstractPluginEnvironment.cs):

  • Path resolution integrated at file existence checks and plugin instantiation
  • File dialog selections automatically converted to relative paths when applicable
  • Backward compatible - existing absolute paths unchanged

UI (SettingsPaneGeneral.xaml):

  • Added path format descriptions with examples

Usage

Users can now configure:

Python Path: .\runtimes\python\pythonw.exe
Node.js Path: .\runtimes\nodejs\node.exe

Paths are stored as-entered (relative or absolute), resolved to absolute only at execution. File picker selections within ProgramDirectory are automatically stored as relative paths.

Enables truly portable setups with embedded runtimes that survive directory moves, USB installations, and restricted environments.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support for Relative Path for Portable Version</issue_title>
<issue_description>## Is your feature request related to a problem? Please describe.

Flow Launcher currently requires absolute paths to execute binaries such as Python and Node.js. This creates issues when using the portable version, since paths change depending on where Flow Launcher is extracted or moved.
As a result, it is not possible to fully use Flow Launcher in a portable way with embedded runtimes, limiting its usability in portable setups, restricted corporate environments, or isolated systems.

Describe the solution you'd like

I would like Flow Launcher to support relative paths, allowing:

  • Executables to be defined using paths relative to the Flow Launcher root directory
  • Running embedded Python and Node.js runtimes directly from the portable folder
Image

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@prlabeler prlabeler bot added bug Something isn't working enhancement New feature or request labels Jan 24, 2026
@github-actions github-actions bot added this to the 2.1.0 milestone Jan 24, 2026
Copilot AI changed the title [WIP] Add support for relative paths in portable version Support relative paths for Python/Node.js executables in portable mode Jan 24, 2026
Copilot AI requested a review from Jack251970 January 24, 2026 07:55
Removed logic that converted selected Python and Node executable
paths to relative if within the program directory. Now, the
selected file paths are stored as absolute paths without
conversion. This simplifies path handling and improves clarity.
Removed the PathResolutionTest.cs file, which contained unit tests for the Constant class's path resolution methods. These tests covered absolute, relative, UNC, null, and empty path scenarios, as well as round-trip conversions.
@gitstream-cm
Copy link

gitstream-cm bot commented Jan 24, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs

Activity based on git-commit:

Jack251970
JAN
DEC
NOV
OCT
SEP 17 additions & 28 deletions
AUG

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs

Activity based on git-commit:

Jack251970
JAN
DEC
NOV
OCT
SEP 29 additions & 27 deletions
AUG

Knowledge based on git-blame:
Jack251970: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Move ResolveAbsolutePath and ConvertToRelativePathIfPossible from Constant to DataLocation for better organization. Update all references accordingly; implementations remain unchanged. This improves code clarity around file path management.
Eliminated the unnecessary using statement for Flow.Launcher.Infrastructure in AbstractPluginEnvironment.cs, as its types or members are no longer referenced in this file. This helps clean up the code and avoid redundant dependencies.
Removed logic that converted absolute paths to relative paths within the ProgramDirectory. Now, plugin settings file paths are always stored as absolute paths. Deleted the ConvertToRelativePathIfPossible method and updated usages accordingly.
@Jack251970 Jack251970 closed this Jan 24, 2026
@jjw24 jjw24 removed this from the 2.1.0 milestone Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 min review bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Relative Path for Portable Version

3 participants