You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
On Windows, Red added to the path, can't be run from another folder on cmd #543
This appears to be an issue with the encapper not being able to gracefully handle cases where it is not invoked via a fully specified path.
It should have been able to use system/options/boot to do this without error, but... Rebol 2 and its encapper are not open source. So unless it is hacked...or its requests to the filesystem hooked somehow... a simple workaround would be to invoke red through a batch file, which forces a fully specified path.
To do that: rename red.exe to red-exe.exe, and in the same directory as that executable put a red.bat file containing the following line:
"%~dp0red-exe.exe" %*
Moving the exe out of the way means the batch file will be preferred. The quotes sanitize the path, which uses the cryptic %~dp0 to get the path (no close percent used, unlike envrionment variables). The %* is a construct for taking the individual arguments, e.g. %1 %2 ... %n.
Reacted by peizhe.chen, Alex Baban, Guo Shuai, Stephen Oates and Daniel
I had this same issue when I was trying to get sublime text to use red as a build system on Ubuntu 15.04.
My solution was similar; I created a shell script like this:
For the Windows batch file, I'd add a @ in front, like this:
@"%~dp0red-exe.exe" %*
The way I've actually used it is by dropping the executable to my C:\Utils\ folder (it's in the PATH variable) and also creating a red.bat file there with @"%~dp0red-063.exe" %* in it (I kept the original filename to keep track of the version I'm using).
Reacted by Nenad Rakocevic, Rok Fajfar, Gary Siu, Alex Baban, Daniel and István Földházi
Activity
dockimbel commentedon Sep 30, 2013
Some other crashing case (and workaround):
hostilefork commentedon Sep 30, 2013
This appears to be an issue with the encapper not being able to gracefully handle cases where it is not invoked via a fully specified path.
It should have been able to use
system/options/bootto do this without error, but... Rebol 2 and its encapper are not open source. So unless it is hacked...or its requests to the filesystem hooked somehow... a simple workaround would be to invoke red through a batch file, which forces a fully specified path.To do that: rename red.exe to red-exe.exe, and in the same directory as that executable put a red.bat file containing the following line:
Moving the exe out of the way means the batch file will be preferred. The quotes sanitize the path, which uses the cryptic
%~dp0to get the path (no close percent used, unlike envrionment variables). The%*is a construct for taking the individual arguments, e.g.%1 %2 ... %n.dockimbel commentedon Sep 30, 2013
Thanks a lot @hostilefork.
AJMansfield commentedon Oct 25, 2015
I had this same issue when I was trying to get sublime text to use red as a build system on Ubuntu 15.04.
My solution was similar; I created a shell script like this:
and called that instead.
cdokolas commentedon Jul 28, 2017
For the Windows batch file, I'd add a
@in front, like this:The way I've actually used it is by dropping the executable to my
C:\Utils\folder (it's in thePATHvariable) and also creating ared.batfile there with@"%~dp0red-063.exe" %*in it (I kept the original filename to keep track of the version I'm using).