-
-
Notifications
You must be signed in to change notification settings - Fork 548
Support relative paths for Python/Node.js executables in portable mode #4229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Jack251970 <[email protected]>
Co-authored-by: Jack251970 <[email protected]>
…portability Co-authored-by: Jack251970 <[email protected]>
This reverts commit 864eedd.
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.
|
🥷 Code experts: Jack251970 Jack251970 has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
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.
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 onProgramDirectoryConvertToRelativePathIfPossible(): Auto-converts absolute paths withinProgramDirectoryto relative format for storagePlugin environment (
AbstractPluginEnvironment.cs):UI (
SettingsPaneGeneral.xaml):Usage
Users can now configure:
Paths are stored as-entered (relative or absolute), resolved to absolute only at execution. File picker selections within
ProgramDirectoryare automatically stored as relative paths.Enables truly portable setups with embedded runtimes that survive directory moves, USB installations, and restricted environments.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.