[GH-ISSUE #293] Protocol app can't be run from the PATH #2174

Closed
opened 2026-03-01 17:18:22 +03:00 by kerem · 19 comments
Owner

Originally created by @majkinetor on GitHub (Sep 26, 2022).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/293

Originally assigned to: @VShawn on GitHub.

Is your enhancement related to a problem? Please describe.
I have wfreerdp.exe on the PATH. I still have to specify full PATH to it in PRM options.

Describe the solution you'd like
If it is on the PATH it should run just by the name. This can be used to integrate it with less config with other tools.

Additional context

The chocolatey bin folder is on the PATH:

image

BTW, since latest release of PRM, wfreerdp is not embedded as connection tab, in previous it was (the same version of wfreerdp).

Originally created by @majkinetor on GitHub (Sep 26, 2022). Original GitHub issue: https://github.com/1Remote/1Remote/issues/293 Originally assigned to: @VShawn on GitHub. **Is your enhancement related to a problem? Please describe.** I have wfreerdp.exe on the PATH. I still have to specify full PATH to it in PRM options. **Describe the solution you'd like** If it is on the PATH it should run just by the name. This can be used to integrate it with less config with other tools. **Additional context** The chocolatey `bin` folder is on the PATH: ![image](https://user-images.githubusercontent.com/85767/192323079-d38d93db-fe24-46b1-b3dd-26104168fb0d.png) BTW, since latest release of PRM, wfreerdp is not embedded as connection tab, in previous it was (the same version of wfreerdp).
kerem 2026-03-01 17:18:22 +03:00
Author
Owner

@majkinetor commented on GitHub (Sep 27, 2022):

Env vars could be supported to for portability reasons.

<!-- gh-comment-id:1259882638 --> @majkinetor commented on GitHub (Sep 27, 2022): Env vars could be supported to for portability reasons.
Author
Owner

@VShawn commented on GitHub (Sep 29, 2022):

Reading paths from environment variables was never considered before.

I make this feature now:

PRemoteM.0.7.1.7.beta.2-x64.zip

<!-- gh-comment-id:1261855918 --> @VShawn commented on GitHub (Sep 29, 2022): Reading paths from environment variables was never considered before. I make this feature now: [PRemoteM.0.7.1.7.beta.2-x64.zip](https://github.com/1Remote/PRemoteM/files/9671894/PRemoteM.0.7.1.7.beta.2-x64.zip)
Author
Owner

@majkinetor commented on GitHub (Sep 29, 2022):

That doesnt seem to work:

You implemented usage of env vars, such as: %ChocolateyInstall%\bin\wfreerdp.exe and %FOO%\bar.exe and in both cases it doesn't work, and doesn't even report exe missing - i just get blank black screen.

Also, since I have %ChocolateyInstall%\bin on the PATH env. var, it should work without any path.

So we have 2 features here:

  1. Accept arbitrary env var in path
  2. Check if exe is available on PATH env var
<!-- gh-comment-id:1262211578 --> @majkinetor commented on GitHub (Sep 29, 2022): That doesnt seem to work: You implemented usage of env vars, such as: `%ChocolateyInstall%\bin\wfreerdp.exe` and `%FOO%\bar.exe` and in both cases it doesn't work, and doesn't even report exe missing - i just get blank black screen. Also, since I have `%ChocolateyInstall%\bin` on the `PATH` env. var, it should work without any path. So we have 2 features here: 1. Accept arbitrary env var in path 2. Check if exe is available on `PATH` env var
Author
Owner

@majkinetor commented on GitHub (Sep 29, 2022):

Second thing is way more important, as it allows one to install arbitrary protocols and PRM will just be able to work with them:

cinst premotem vnc winspc wfreerdp ....

Then Premotem can even come with predefined protocols that will just work if the app is somewhere on the system.

<!-- gh-comment-id:1262561411 --> @majkinetor commented on GitHub (Sep 29, 2022): Second thing is way more important, as it allows one to install arbitrary protocols and PRM will just be able to work with them: `cinst premotem vnc winspc wfreerdp ....` Then Premotem can even come with predefined protocols that will just work if the app is somewhere on the system.
Author
Owner

@VShawn commented on GitHub (Sep 30, 2022):

image

image

image

IT WORKS ON ME.

How your PATH be like? Maybe the path format will affect PRM reading.

<!-- gh-comment-id:1262973358 --> @VShawn commented on GitHub (Sep 30, 2022): ![image](https://user-images.githubusercontent.com/10143738/193165350-fe1d6676-fab5-497c-a388-e7959835beca.png) ![image](https://user-images.githubusercontent.com/10143738/193165390-9634543e-5bf5-41a6-8638-8b56e9995825.png) ![image](https://user-images.githubusercontent.com/10143738/193165514-8708c595-12fd-41eb-bcac-db3295d7341b.png) IT WORKS ON ME. How your PATH be like? Maybe the path format will affect PRM reading.
Author
Owner

@VShawn commented on GitHub (Sep 30, 2022):

test the path with %BlabLA%\bio

works too

image

<!-- gh-comment-id:1263063581 --> @VShawn commented on GitHub (Sep 30, 2022): test the path with `%BlabLA%\bio` works too ![image](https://user-images.githubusercontent.com/10143738/193184612-632582c3-7da7-44c3-bf08-8e78f6e094a7.png)
Author
Owner

@majkinetor commented on GitHub (Oct 2, 2022):

Using path in PATH env var

PATH

image

wfreerdp

image

Protocol

image

Connection

image

Result: popup :

image

Setting path using env var inside it

I also tried to use ChocolateyInstall env var inside wfreerdp path:

wfreerdp

image

Connection

image

Result: black screen

image

image

<!-- gh-comment-id:1264690674 --> @majkinetor commented on GitHub (Oct 2, 2022): ### _Using_ path in `PATH` env var <details><summary>PATH</summary> ![image](https://user-images.githubusercontent.com/85767/193466623-aff8e196-ba87-42f3-a28b-646b646d292a.png)</details> <details><summary>wfreerdp</summary> ![image](https://user-images.githubusercontent.com/85767/193466647-03f618bf-6cf7-48e5-bbbe-b0062174dcc0.png) </details> <details><summary>Protocol</summary> ![image](https://user-images.githubusercontent.com/85767/193466690-b2d34036-0df8-4b19-ad9c-aae52657a65c.png) </details> <details><summary>Connection</summary> ![image](https://user-images.githubusercontent.com/85767/193466756-f78fb096-6457-4d38-9cad-a49a3c89dab3.png) </details> <details><summary>Result: popup</summary> : ![image](https://user-images.githubusercontent.com/85767/193466766-fe2db36d-b512-4260-94db-85fd1480f02e.png) </details> ### Setting path using env var inside it I also tried to use `ChocolateyInstall` env var inside wfreerdp path: <details><summary>wfreerdp</summary> ![image](https://user-images.githubusercontent.com/85767/193466802-3b15c6e2-b0d9-4f8f-9b13-a69ebe5b062e.png) </details> <details><summary>Connection</summary> ![image](https://user-images.githubusercontent.com/85767/193467061-fe9353f6-e1c1-4e5f-b965-ee1600e47fc4.png) </details> <details><summary>Result: black screen</summary> ![image](https://user-images.githubusercontent.com/85767/193466897-68a31ddc-5db5-43ff-9e0e-0db06261fbcc.png) </details> ![image](https://user-images.githubusercontent.com/85767/193466923-0b5144ca-1d03-40c3-b01e-fdbe7d364304.png)
Author
Owner

@VShawn commented on GitHub (Oct 5, 2022):

Ahh, I tested it on APP protocol, no test on the runner, let me check the runner path after I back home from vacation.

<!-- gh-comment-id:1267856058 --> @VShawn commented on GitHub (Oct 5, 2022): Ahh, I tested it on `APP` protocol, no test on the runner, let me check the runner path after I back home from vacation.
Author
Owner

@VShawn commented on GitHub (Oct 13, 2022):

A bug was found in external runner path checker which make PATH not work.

PRemoteM.0.7.1.7.beta.3-x64.zip

<!-- gh-comment-id:1277153388 --> @VShawn commented on GitHub (Oct 13, 2022): A bug was found in external runner path checker which make PATH not work. [PRemoteM.0.7.1.7.beta.3-x64.zip](https://github.com/1Remote/PRemoteM/files/9771889/PRemoteM.0.7.1.7.beta.3-x64.zip)
Author
Owner

@majkinetor commented on GitHub (Oct 13, 2022):

First case now works, second case still doesn't.

<!-- gh-comment-id:1277170189 --> @majkinetor commented on GitHub (Oct 13, 2022): First case now works, second case still doesn't.
Author
Owner

@VShawn commented on GitHub (Oct 13, 2022):

second case is chocolatey case? I don't have a chocolatey installed, maybe test it later.

<!-- gh-comment-id:1277250130 --> @VShawn commented on GitHub (Oct 13, 2022): second case is chocolatey case? I don't have a chocolatey installed, maybe test it later.
Author
Owner

@majkinetor commented on GitHub (Oct 13, 2022):

No, I just used choco as an example:

For example try %SystemRoot%\notepad.exe

<!-- gh-comment-id:1277251732 --> @majkinetor commented on GitHub (Oct 13, 2022): No, I just used choco as an example: For example try `%SystemRoot%\notepad.exe`
Author
Owner

@VShawn commented on GitHub (Oct 13, 2022):

Ahhh I see, you means using the environment variable in path directly.

<!-- gh-comment-id:1277256126 --> @VShawn commented on GitHub (Oct 13, 2022): Ahhh I see, you means using the environment variable in path directly.
Author
Owner

@majkinetor commented on GitHub (Oct 13, 2022):

Yeah, things like that are needed for portability. If you carry your PRM with you (or copy it to another system), and it relies on tools on the local system, for it to work you generaly need to use env vars to avoid possible path changes on each system.

<!-- gh-comment-id:1277271914 --> @majkinetor commented on GitHub (Oct 13, 2022): Yeah, things like that are needed for portability. If you carry your PRM with you (or copy it to another system), and it relies on tools on the local system, for it to work you generaly need to use env vars to avoid possible path changes on each system.
Author
Owner

@majkinetor commented on GitHub (Oct 13, 2022):

This will especially be useful in multiuser scneario with relational db holding data.

<!-- gh-comment-id:1277272513 --> @majkinetor commented on GitHub (Oct 13, 2022): This will especially be useful in multiuser scneario with relational db holding data.
Author
Owner

@VShawn commented on GitHub (Oct 13, 2022):

goal, tested with winscp :)

image

PRemoteM.0.7.1.7.beta.3-x64.zip

<!-- gh-comment-id:1277293150 --> @VShawn commented on GitHub (Oct 13, 2022): goal, tested with winscp :) ![image](https://user-images.githubusercontent.com/10143738/195555832-e3333264-91e2-45f2-beda-c08967bd9098.png) [PRemoteM.0.7.1.7.beta.3-x64.zip](https://github.com/1Remote/PRemoteM/files/9774934/PRemoteM.0.7.1.7.beta.3-x64.zip)
Author
Owner

@majkinetor commented on GitHub (Oct 13, 2022):

Works now.

<!-- gh-comment-id:1277295837 --> @majkinetor commented on GitHub (Oct 13, 2022): Works now.
Author
Owner

@VShawn commented on GitHub (Oct 13, 2022):

god damn GFW, I can not push to github now.

fatal: Could not read from remote repository.

<!-- gh-comment-id:1277298057 --> @VShawn commented on GitHub (Oct 13, 2022): god damn GFW, I can not push to github now. ` fatal: Could not read from remote repository. `
Author
Owner

@majkinetor commented on GitHub (Oct 13, 2022):

Probably temporary

<!-- gh-comment-id:1277299028 --> @majkinetor commented on GitHub (Oct 13, 2022): Probably temporary
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/1Remote#2174
No description provided.