Re: path trouble on 40a3
- Posted by Kat Mar 17, 2009
- 1100 views
On the 4.0a3 installer, you can choose to have it update the environment or not update the environment. Many will choose not to as they are still using 3.1.1 or a version of 4.0 that they know is stable for them. So, those that decide not to update the environment, the installer then creates a batch file in the install directory named setenv.bat
This batch file is built by the installer and will set the EUDIR and add %EUDIR%\bin to the path. Thus, when you are testing with 4.0a3, you can do something like:
C:\Develop\My40a3Tests> \euphoria40a3\setenv.bat C:\Develop\My40a3Tests> exwc hello_regex.ex
By calling setenv.bat, everything is done for you, providing you do not move your installation directory after the fact. If you do that, you'll have to update the setenv.bat file to reflect that change.
Jeremy
Instead, i edited the setenv.bat and renamed it to this_eu.bat (but the name doesn't matter).
The .bat file:
@echo off REM Set the environment for *THIS* installation of Euphoria REM these vars are for THIS environment only, REM not for any other Euphoria app on another drive SETLOCAL REM 1st, set the EUDIR REM this file must be in the local Euphoria root directory to work, REM whatever the drive SET EUDIR=%CD% REM 2nd, set the EUINC to your favorite paths SET EUINC=%CD%\;%CD%\bin\;%CD%\include\;%CD%\include\std\ REM second, add the path of the application folder to the EUINC set APP_DIR=%~dp1 SET EUINC=%APP_DIR%;%EUINC% REM now run the interpreter with these EUINCs in the environment START /B %CD%\bin\exw.exe %* EXIT
It seems to work, and is independant of where the Euphoria copy is on what drive. I changed the Run tool in Textpad to run the .bat and start minimized, since the bat runs first and makes for screen flicker.
Reasons i do not want to hardcode the envvars for Eu:
1) A bug in winxp that wasn't on win95: eithr winxp or textpad will trash a file textpad is displaying, if that source code is running, and if xp says it must close textpad for any reason, or if xp crashes, including power outage. The source code is totally trashed and unrecoverable.
2) If editing an app that textpad is displaying, the *running* source code is corrupted even if it's already running, if the new code is saved, leading to mandating main() be used, since it seems the interpreter loads/parses functions/procedures before top level code. This may be different in Eu v4.
3) If i am developing and bebugging code, i do not want that new code in my working, running, bugless eudir
4) If i change drives, all absolute spec'd paths are now bad ( i use currentdir() a *lot* )
5) One week, i lost *3* harddrives and all their contents, i need backups, backups that work, regardless of hardcoded eudirs.
useless