Flow-Launcher / Flow.Launcher

:mag: Quick file search & app launcher for Windows with community-made plugins
https://flowlauncher.com
MIT License
7.66k stars 301 forks source link

Not automatically propagating system environment variables #1602

Open Tobias3107 opened 1 year ago

Tobias3107 commented 1 year ago

Hey Guys,

Im working for a Company where we working sometimes with Enviroment Variables. I always compile and start the Programm with Flow.Launcher. Thats easy and fast but when i working with Enviroment Variables i have to restart Flow.Launcher or start it manually.

Normaly all Programs when they start other Programs they give them their version of Enviroment Variables. So when the programm is started and the Variables changed then the Program has the Old version of the Variables and start Programs with that Old Version.

It would be nice that the Programs always start with the newest version of the Program variables. (If it is Possible) I tried to create a Plugin with that feature but i dont get far. I want to do this part of my life faster maybe you can help me with that.

Cheers Tobias

VictoriousRaptor commented 1 year ago

Maybe it's tricky. Prerelease version provides the function of indexing program in PATH but it doesn't update automatically.

I suppose your program is at some_variable\xxx.exe so if you want to make a plugin for your self, just set a keyword, read the env variable everytime you trigger it, and show the program as a result. You can find examples in Program plugin.

VictoriousRaptor commented 1 year ago

And an alternative way is to make a .bat or .lnk or something else points to the target. A lot easier than making a plugin.

jjw24 commented 1 year ago

Assuming the root cause is the path to the program being part env variable, does a reload of plugin data work? (Press F5) This should reindex Program plugin's programs.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stale for 7 days with no activity. If you feel this issue still needs attention please feel free to reopen.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stale for 7 days with no activity. If you feel this issue still needs attention please feel free to reopen.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 11 months ago

This issue was closed because it has been stale for 7 days with no activity. If you feel this issue still needs attention please feel free to reopen.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

NiTiSon commented 9 months ago

This isn't fixed yet?!

jjw24 commented 9 months ago

No, haven't thought of a solution yet.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.

RichardLuo0 commented 7 months ago

I wish there is a button in the tray menu that allows me to refresh env variable. Not a perfect solution but it should be enough.

NiTiSon commented 7 months ago

Where is code line that run process?

taooceros commented 7 months ago

Where is code line that run process?

@NiTiSon https://github.com/Flow-Launcher/Flow.Launcher/blob/1f99d0da4f8d820a764c0cb85c3d25f0b3b8b49d/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs#L181-L206

NiTiSon commented 7 months ago

Where is code line that run process?

@NiTiSon https://github.com/Flow-Launcher/Flow.Launcher/blob/1f99d0da4f8d820a764c0cb85c3d25f0b3b8b49d/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs#L181-L206

We probably need to copy all system envirounments to process start info?!

https://learn.microsoft.com/en-gb/dotnet/api/system.diagnostics.processstartinfo.environmentvariables?view=net-8.0#system-diagnostics-processstartinfo-environmentvariables

taooceros commented 7 months ago

Feel free to give it a try. I am not sure how the path update works in windows.

RichardLuo0 commented 5 months ago

I want to mention that Chocolatey seems to have found a way to refresh env, I hope this is useful https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd

jjw24 commented 2 months ago

Also as a fyi workaround please see if pressing F5) to reload plugin data refreshes the env variables for programs.