1. How to install Euphoria on a USB flash drive?

Hi all,

I would really like to carry all my important programs and documents
with me in my pocket! This includes Euphoria, of course. smile

So how can Euphoria be installed on a USB flash drive? As I see it, the
problem is how to set the PATH, EUDIR and EUINC environment variables
properly. When I connect my USB flash drive to the computer of a friend,
of course I don't want to edit the 'autoexec.bat' file and reboot the
system in order to be able to run Euphoria.

I would appreciate it very much, if someone knows a solution right now
for Eu 2.5 (or below).

If there is no solution currently, maybe something could be done in the
next Euphoria release? I think the EUDIR and EUINC variables are "only"
used by Euphoria itself. So as far as I can see it's not necessary to
implement them as environment variables. The same effect can be achieved
by a file say '.....\euphoria\bin\euphoria.ini', that contains something
like:
       [Directories]
       EUDIR=...
       EUINC=...
If I am right, this way of setting the variables is more portable than
setting these variables as environment variables of the OS.

So the remaining problem is the PATH. Well, if there is no solution, I
think for me personally this would be not a big problem (I only talk
about DOS/Windows, since I know almost nothing about Linux/FreeBSD),
becazse I can use *relative* names in batch files to call my Euphoria
programs on the USB flash drive.

What do you all think?

Regards,
   Juergen

-- 
A: Because it considerably reduces the readability of the text.
Q: Why?
A: Top posting.
Q: What is annoying in e-mail and news?

new topic     » topic index » view message » categorize

2. Re: How to install Euphoria on a USB flash drive?

You know what is really cool, on current motherboards the bios will
make usb drives into real drives, and you can even boot off of them.
That way you could put dos and euphoria on the drive and have lots of
euphoria on anyones computer.

Dan

On 11/22/05, Juergen Luethje <j.lue at gmx.de> wrote:
>
>
> Hi all,
>
> I would really like to carry all my important programs and documents
> with me in my pocket! This includes Euphoria, of course. smile
>
> So how can Euphoria be installed on a USB flash drive? As I see it, the
> problem is how to set the PATH, EUDIR and EUINC environment variables
> properly. When I connect my USB flash drive to the computer of a friend,
> of course I don't want to edit the 'autoexec.bat' file and reboot the
> system in order to be able to run Euphoria.
>
> I would appreciate it very much, if someone knows a solution right now
> for Eu 2.5 (or below).
>
> If there is no solution currently, maybe something could be done in the
> next Euphoria release? I think the EUDIR and EUINC variables are "only"
> used by Euphoria itself. So as far as I can see it's not necessary to
> implement them as environment variables. The same effect can be achieved
> by a file say '.....\euphoria\bin\euphoria.ini', that contains something
> like:
>       [Directories]
>       EUDIR=...
>       EUINC=...
> If I am right, this way of setting the variables is more portable than
> setting these variables as environment variables of the OS.
>
> So the remaining problem is the PATH. Well, if there is no solution, I
> think for me personally this would be not a big problem (I only talk
> about DOS/Windows, since I know almost nothing about Linux/FreeBSD),
> becazse I can use *relative* names in batch files to call my Euphoria
> programs on the USB flash drive.
>
> What do you all think?
>
> Regards,
>   Juergen
>
> --
> A: Because it considerably reduces the readability of the text.
> Q: Why?
> A: Top posting.
> Q: What is annoying in e-mail and news?
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: How to install Euphoria on a USB flash drive?

Well, there is the command-line tool 'set'.
So, if you have a batch file for the program you want to run:
(Assuming that there is a bin folder and a include folder inside the
directory you run the batch file from)
<runmyprog.bat>
set PATH="%PATH%";"%CD%\bin"
set EUDIR="%CD%\bin"
set EUINC="%CD%\include"
set MYPROGRAMSTUFFLOCATION="%CD%\myprogram\myprogramsstuff"
exw myprogram\myprogram.exw
</runmyprog.bat>

(%CD% is a batch file thing containing the current directory.)


Now, the set command only sticks for the current session, so if you
use set in a batch script, it's effects are only felt within that
script. If you want to have a batch file that you run on connecting
the drive, and from then on everything works fine, then use setx - you
need more priveleges to use the command, but it is a permanent
addition.
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.=
asp

Hope that helps...

On 11/23/05, Juergen Luethje <j.lue at gmx.de> wrote:
> I would really like to carry all my important programs and documents
> with me in my pocket! This includes Euphoria, of course. smile
>
> So how can Euphoria be installed on a USB flash drive? As I see it, the
> problem is how to set the PATH, EUDIR and EUINC environment variables
> properly. When I connect my USB flash drive to the computer of a friend,
> of course I don't want to edit the 'autoexec.bat' file and reboot the
> system in order to be able to run Euphoria.
>
> I would appreciate it very much, if someone knows a solution right now
> for Eu 2.5 (or below).
>
> If there is no solution currently, maybe something could be done in the
> next Euphoria release? I think the EUDIR and EUINC variables are "only"
> used by Euphoria itself. So as far as I can see it's not necessary to
> implement them as environment variables. The same effect can be achieved
> by a file say '.....\euphoria\bin\euphoria.ini', that contains something
> like:
>        [Directories]
>        EUDIR=...
>        EUINC=...
> If I am right, this way of setting the variables is more portable than
> setting these variables as environment variables of the OS.
>
> So the remaining problem is the PATH. Well, if there is no solution, I
> think for me personally this would be not a big problem (I only talk
> about DOS/Windows, since I know almost nothing about Linux/FreeBSD),
> becazse I can use *relative* names in batch files to call my Euphoria
> programs on the USB flash drive.
>
> What do you all think?
>
> Regards,
>    Juergen
>
> --
> A: Because it considerably reduces the readability of the text.
> Q: Why?
> A: Top posting.
> Q: What is annoying in e-mail and news?
>
>
>
>


--
MrTrick
----------

new topic     » goto parent     » topic index » view message » categorize

4. Re: How to install Euphoria on a USB flash drive?

> What do you all think?

I have to do the same thing at work, since I'm at users' machines.

Step 1: Save the following to install_eu.bat inside your Euphoria directory

@echo off
set EUDIR=%CD%
set EUINC=%EUDIR%\INCLUDE
set PATH=%PATH%;%EUDIR%\BIN
echo Euphoria Installed!

Step 2: On any given machine, open up a new command line and cd into
your Euphoria directory, then run install_eu.bat. Minimize the command
window, DON'T CLOSE IT!

The trick is that the environment variables setup in the command
window are local and will go away when you close it, *but* will work
as long as it remains open. Simply close the command window when you
are finished.

~Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: How to install Euphoria on a USB flash drive?

On 11/23/05, Greg Haberek <ghaberek at gmail.com> wrote:
> Step 1: Save the following to install_eu.bat inside your Euphoria directo=
ry
>
> @echo off
> set EUDIR=%CD%
> set EUINC=%EUDIR%\INCLUDE
> set PATH=%PATH%;%EUDIR%\BIN
> echo Euphoria Installed!

Uh, a word of warning: If you don't put quotes around the set values,
you'll get REALLY bad results if any of PATH, CD, EUDIR, etc contain
spaces.

> Step 2: On any given machine, open up a new command line and cd into
> your Euphoria directory, then run install_eu.bat. Minimize the command
> window, DON'T CLOSE IT!

Replacing set with setx will make changes permanent.

--
MrTrick
----------

new topic     » goto parent     » topic index » view message » categorize

6. Re: How to install Euphoria on a USB flash drive?

Hi there,

I had submitted a program to the archives a while back that sets
registry variables, including Environment vars and stuff like that.
In your case you may wish to read the old values and save them
before you change anything so you can put them back when you're done.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

7. Re: How to install Euphoria on a USB flash drive?

Greg Haberek wrote:
> 
> > What do you all think?
> 
> I have to do the same thing at work, since I'm at users' machines.
> 
> Step 1: Save the following to install_eu.bat inside your Euphoria directory
> 
> @echo off
> set EUDIR=%CD%
> set EUINC=%EUDIR%\INCLUDE
> set PATH=%PATH%;%EUDIR%\BIN
> echo Euphoria Installed!
> 
> Step 2: On any given machine, open up a new command line and cd into
> your Euphoria directory, then run install_eu.bat. Minimize the command
> window, DON'T CLOSE IT!
> 
> The trick is that the environment variables setup in the command
> window are local and will go away when you close it, *but* will work
> as long as it remains open. Simply close the command window when you
> are finished.
> 
> ~Greg
> 
> 

Of course you can also setup these user variables in environment variable
properties window. That is what I normally do, but I suppose there is a bit of
convienence having a batch file do it.

Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

8. Re: How to install Euphoria on a USB flash drive?

Hi Patrick!

> Well, there is the command-line tool 'set'.
> So, if you have a batch file for the program you want to run:
> (Assuming that there is a bin folder and a include folder inside the
> directory you run the batch file from)
> <runmyprog.bat>
> set PATH="%PATH%";"%CD%\bin"
> set EUDIR="%CD%\bin"
> set EUINC="%CD%\include"
> set MYPROGRAMSTUFFLOCATION="%CD%\myprogram\myprogramsstuff"
> exw myprogram\myprogram.exw
> </runmyprog.bat>

OK, I see the idea. I have to get the directory where Euphoria is
(well I know already the directory structure, the only thing I don't
know is the current drive letter of the USB flash drive). Then I have to
set the concerning environment variables for the current session.

> (%CD% is a batch file thing containing the current directory.)

Oh, very useful! Unfortunately this system variable does not exist e.g.
on Windows 98. sad

If possible, I want to get a solution that works for all Windows
versions on which Euphoria runs. So I wrote the following Euphoria
program:
---------------------[ getdrive.exw ]---------------------
constant
cmd = command_line(),
fn = open("setdrive.bat", "w")

if fn = -1 then
   abort(1)         -- A batch file can check this errorlevel.
end if
printf(fn, "@set dr=%s\n", {cmd[2][1]})  -- write drive letter
close(fn)
----------------------------------------------------------


This program must be in the root directory of the USB flash drive as
bound or compiled .EXE file. When it runs, it produces the file
'setdrive.bat' that contains only one line, e.g.:

   @set dr=F

Then I modified your batch file above, so that it now looks like this:

---------------------[ eurun.bat ]---------------------
@echo off
start /w \getdrive.exe
call setdrive.bat
del setdrive.bat
set EUDIR=%dr%:\prog\euphoria
set EUINC=%eudir%\inc_usr
set PATH=%eudir%\bin;%PATH%
%1 %2 %3 %4 %5
-----------------------------------------------------------

I can use this batch file for running *all* my Eu programs on the USB
flash drive:
     eurun exw  foo.exw
     eurun exwc bar.exw
     etc.

> Now, the set command only sticks for the current session, so if you
> use set in a batch script, it's effects are only felt within that
> script. If you want to have a batch file that you run on connecting
> the drive, and from then on everything works fine, then use setx - you
> need more priveleges to use the command, but it is a permanent
> addition.
> http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.asp

Very cool! I've been looking for something like that for a long time.
Unfortunately it did not work on my system. Then I read on the internet
that it is intended only for Windows NT,2000,XP,2003.

> Hope that helps...

Yes, it helped a lot. Thanks!

Regards,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

9. Re: How to install Euphoria on a USB flash drive?

Greg Haberek wrote:

>> What do you all think?
>
> I have to do the same thing at work, since I'm at users' machines.
>
> Step 1: Save the following to install_eu.bat inside your Euphoria directory
>
> @echo off
> set EUDIR=%CD%
> set EUINC=%EUDIR%\INCLUDE
> set PATH=%PATH%;%EUDIR%\BIN
> echo Euphoria Installed!
>
> Step 2: On any given machine, open up a new command line and cd into
> your Euphoria directory, then run install_eu.bat. Minimize the command
> window, DON'T CLOSE IT!
>
> The trick is that the environment variables setup in the command
> window are local and will go away when you close it, *but* will work
> as long as it remains open. Simply close the command window when you
> are finished.

I got the basic idea, and made some changes that meet my personal habits
(please see reply to Patrick for details).

Thanks,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

10. Re: How to install Euphoria on a USB flash drive?

Me wrote:

<snip>

> ---------------------[ eurun.bat ]---------------------
> @echo off
> start /w \getdrive.exe
> call setdrive.bat
> del setdrive.bat
> set EUDIR=%dr%:\prog\euphoria
> set EUINC=%eudir%\inc_usr
> set PATH=%eudir%\bin;%PATH%
> %1 %2 %3 %4 %5
> -----------------------------------------------------------
>
> I can use this batch file for running *all* my Eu programs on the USB
> flash drive:
>      eurun exw  foo.exw
>      eurun exwc bar.exw
>      etc.

<snip>

Now instead of one batch file for all programs, I have made three files:
     ex.bat, exw.bat, exwc.bat

They all look like 'eurun.bat' above, except for the last line. The last
lines are
     ex.exe %1 %2 %3 %4 %5
     exw.exe %1 %2 %3 %4 %5
     exwc.exe %1 %2 %3 %4 %5
respectively.

All three batch files are in the root directory of the USB drive. So
from anywhere on the USB drive, I can type e.g.
     \exw foo.exw
     \exwc bar.exw

These commands work not only when I type them at the prompt of a console
window, but also when I type them e.g. on the built-in command line of
Total Commander. Except of the \ at the beginning, it's exactly the same
what I type when using the "normal" copy of Euphoria, which is installed
on my hard drive. Cool. smile

Regards,
   Juergen

-- 
A: Because it considerably reduces the readability of the text.
Q: Why?
A: Top posting.
Q: What is annoying in e-mail and news?

new topic     » goto parent     » topic index » view message » categorize

11. Re: How to install Euphoria on a USB flash drive?

Why is everyone using batch files ?
Why can't you have all your set commands
given by a system() command in euphoria code.
Put all these commands in a include file and
then if you want to run a euphoria program all
you have to do is include this file at the
top of your program.


Bernie

My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

12. Re: How to install Euphoria on a USB flash drive?

On Wed, 23 Nov 2005 08:02:17 +0100, "Juergen Luethje" <j.lue at gmx.de>
said:
> So how can Euphoria be installed on a USB flash drive? As I see it, the
> problem is how to set the PATH, EUDIR and EUINC environment variables
> properly.
I see you have found a solution. Another one is just to dump everything
in 
same directory, ie exw.exe, misc.e, dll.e, etc, and yourprog.e. Then,
afaik,
you don't need any of the above set. Seems to work on my w98 box anyhow.

Regards,
Pete
-- 
  
  petelomax at fastmail.fm

-- 
http://www.fastmail.fm - Access all of your messages and folders
                          wherever you are

new topic     » goto parent     » topic index » view message » categorize

13. Re: How to install Euphoria on a USB flash drive?

Bernie Ryan wrote:

> Why is everyone using batch files ?
> Why can't you have all your set commands
> given by a system() command in euphoria code.
> Put all these commands in a include file and
> then if you want to run a euphoria program all
> you have to do is include this file at the
> top of your program.

I tried the following:

-----------------[ sys_set.e ]-------------------
system("set EUDIR=h:\\prog\\euphoria", 2) -- h: is my USB drive
system("set EUINC=%eudir%\\inc_usr", 2)
system("set PATH=%eudir%\\bin;%PATH%", 2)
-------------------------------------------------

-----------------[ sys_test.exw ]-----------------
include sys_set.e   -- is located in the same directory

include math.e      -- private lib that contains abs()
? abs(-1)
--------------------------------------------------

It did not work (on Windows 98). IMHO this is because of two reasons:

a) Each system() command will start a new DOS shell. Environment
   variables that are set in a shell will vanish, when the shell doesn't
   exist any more, i.e. immediately after the concerning system()
   command has finished.

b) To avoid problem a), setx (suggested by Patrick) could be used
   (runs only on Windows NT,2000,XP,2003).
   But the main problem of your proposal IMHO is the following
   (please correct me if I'm wrong):
   The environment variables are set at runtime, but the Euphoria
   interpreter must know them beforehand, i.e. at parsing time!

Regards,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

14. Re: How to install Euphoria on a USB flash drive?

petelomax wrote:

> On Wed, 23 Nov 2005 08:02:17 +0100, "Juergen Luethje" said:
>> So how can Euphoria be installed on a USB flash drive? As I see it, the
>> problem is how to set the PATH, EUDIR and EUINC environment variables
>> properly.
> I see you have found a solution. Another one is just to dump everything
> in  same directory, ie exw.exe, misc.e, dll.e, etc, and yourprog.e. Then,
> afaik, you don't need any of the above set. Seems to work on my w98 box
> anyhow.

Oh, yes I see.

Thanks,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

15. Re: How to install Euphoria on a USB flash drive?

Juergen Luethje wrote:
> 
> petelomax wrote:
> 
> > On Wed, 23 Nov 2005 08:02:17 +0100, "Juergen Luethje" said:
> >> So how can Euphoria be installed on a USB flash drive? As I see it, the
> >> problem is how to set the PATH, EUDIR and EUINC environment variables
> >> properly.
> > I see you have found a solution. Another one is just to dump everything
> > in  same directory, ie exw.exe, misc.e, dll.e, etc, and yourprog.e. Then,
> > afaik, you don't need any of the above set. Seems to work on my w98 box
> > anyhow.
> 
> Oh, yes I see.
> 
> Thanks,
>    Juergen
> 
> -- 
> Have you read a good program lately?
> 
> 

The only problem I have with running software off my flash drive is it gets
fairly hot after a while; could I damage it by constantly using it?


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

16. Re: How to install Euphoria on a USB flash drive?

codepilot Gmail Account wrote:

> You know what is really cool, on current motherboards the bios will
> make usb drives into real drives, and you can even boot off of them.
> That way you could put dos and euphoria on the drive and have lots of
> euphoria on anyones computer.

<snip>

I agree that this is cool. That reminds me of Knoppix, which boots from
a CD (maybe it can also boot from a USB drive nowadays). And it can be
very useful for repairing a broken PC, which can't boot from its hard
drive any more. However, for me personally this is a rare exception.

Regards,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

17. Re: How to install Euphoria on a USB flash drive?

Al Getz wrote:

> I had submitted a program to the archives a while back that sets
> registry variables, including Environment vars and stuff like that.
> In your case you may wish to read the old values and save them
> before you change anything so you can put them back when you're done.

In the Readme file of the contribution it reads:
| Also, after you run the file "SetEnvVars.ew" you'll have to either log
| off or reboot to get the changes to take effect.

That's not what I want to do. I just want to connect my USB drive to the
concerning PC, and then immediately run my programs.

Regards,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

18. Re: How to install Euphoria on a USB flash drive?

> The only problem I have with running software off my flash drive is it ge=
ts fairly hot after a while; could I damage it by constantly using it?

I've had a Cruzer Mini 128 for two years now, and I was using it daily
for 4+ hours for a year, then I left it plugged into the back of my
computer for 6 months straight. Still works great!

~Greg

new topic     » goto parent     » topic index » view message » categorize

19. Re: How to install Euphoria on a USB flash drive?

> It did not work (on Windows 98). IMHO this is because of two reasons:

Here's a potential solution:

My EG Interpreter (EG = Euphoria by Greg) has a built-in 'eudir'
keyword. It allows you to set the Euphoria directory inside the
interpeter. I put that in because I was having issues with setting up
Euphoria for CGI on a Linux box, but I guess it applies here, too.

~Greg

new topic     » goto parent     » topic index » view message » categorize

20. Re: How to install Euphoria on a USB flash drive?

Greg Haberek wrote:
> 
> > The only problem I have with running software off my flash drive is it ge=
> ts fairly hot after a while; could I damage it by constantly using it?
> 
> I've had a Cruzer Mini 128 for two years now, and I was using it daily
> for 4+ hours for a year, then I left it plugged into the back of my
> computer for 6 months straight. Still works great!
> 
> ~Greg
> 
> 

Heh, okay... I have a 256 MB Cruzer micro; I guess I worry to much. :P

Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

21. Re: How to install Euphoria on a USB flash drive?

Vincent wrote:
> 
> Greg Haberek wrote:
> > 
> > > The only problem I have with running software off my flash drive is it ge=
> > ts fairly hot after a while; could I damage it by constantly using it?
> > 
> > I've had a Cruzer Mini 128 for two years now, and I was using it daily
> > for 4+ hours for a year, then I left it plugged into the back of my
> > computer for 6 months straight. Still works great!
> > 
> > ~Greg
> > 
> > 
> Heh, okay... I have a 256 MB Cruzer micro; I guess I worry to much. :P
> 
> Regards,
> Vincent

In fact flash memory worn out by writing to it but not by reading. That kind of
memory is best for write seldom/read often usage. Flash memory is organized in
blocks which are written as a whole. Modern flash memory have firmware in it to
distribute write cycles among the blocks to reduce worn out. So if a file is
modified, it is not written back at the same block but to another one that as
been less often rewritten.


regards,
jacques DeschĂȘnes

new topic     » goto parent     » topic index » view message » categorize

22. Re: How to install Euphoria on a USB flash drive?

As I wrote, I came up with something like this:

----------------------[ exw.bat ]----------------------
@echo off
start /w \prog\getdrive.exe
call setdrive.bat
del setdrive.bat
set EUDIR=%dr%:\prog\euphoria
set EUINC=%eudir%\inc_usr
set PATH=%eudir%\bin;%PATH%
exw.exe %1 %2 %3 %4 %5
-------------------------------------------------------

Now it looks to me, as if it is not necessary to change the PATH at all
here. The following seems to work:

----------------------[ exw.bat ]----------------------
@echo off
start /w \prog\getdrive.exe
call setdrive.bat
del setdrive.bat
set EUDIR=%dr%:\prog\euphoria
set EUINC=%eudir%\inc_usr
%eudir%\bin\exw.exe %1 %2 %3 %4 %5
-------------------------------------------------------

Is there any disadvantage, when the PATH is not changed in this context?

Regards,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

23. Re: How to install Euphoria on a USB flash drive?

jacques desch=EAnes wrote:

<snip>

> In fact flash memory worn out by writing to it but not by reading. That
> kind of memory is best for write seldom/read often usage. Flash memory
> is organized in blocks which are written as a whole. Modern flash
> memory have firmware in it to distribute write cycles among the blocks
> to reduce worn out. So if a file is modified, it is not written back at
> the same block but to another one that as been less often rewritten.

Very interesting, thanks!

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu