Flow.Launcher icon indicating copy to clipboard operation
Flow.Launcher copied to clipboard

Not automatically propagating system environment variables

Open Tobias3107 opened this issue 3 years ago • 20 comments

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

Tobias3107 avatar Dec 07 '22 09:12 Tobias3107

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 avatar Dec 07 '22 09:12 VictoriousRaptor

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.

VictoriousRaptor avatar Dec 07 '22 09:12 VictoriousRaptor

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.

jjw24 avatar Jan 13 '23 22:01 jjw24

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] avatar Feb 28 '23 02:02 github-actions[bot]

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] avatar Mar 07 '23 02:03 github-actions[bot]

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] avatar May 06 '23 01:05 github-actions[bot]

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] avatar May 20 '23 01:05 github-actions[bot]

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] avatar Jul 21 '23 01:07 github-actions[bot]

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] avatar Sep 15 '23 01:09 github-actions[bot]

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] avatar Oct 06 '23 01:10 github-actions[bot]

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] avatar Nov 24 '23 01:11 github-actions[bot]

This isn't fixed yet?!

NiTiSon avatar Nov 24 '23 11:11 NiTiSon

No, haven't thought of a solution yet.

jjw24 avatar Nov 26 '23 19:11 jjw24

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] avatar Jan 11 '24 01:01 github-actions[bot]

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.

RichardLuo0 avatar Jan 17 '24 08:01 RichardLuo0

Where is code line that run process?

NiTiSon avatar Jan 17 '24 16:01 NiTiSon

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

taooceros avatar Jan 18 '24 00:01 taooceros

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

NiTiSon avatar Jan 22 '24 13:01 NiTiSon

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

taooceros avatar Jan 22 '24 15:01 taooceros

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

RichardLuo0 avatar Apr 10 '24 13:04 RichardLuo0

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

jjw24 avatar Jul 03 '24 11:07 jjw24