This looks like getting somewhere. A change to cfgread.ijs, if it could
be thought out & made standard, would be a step forward.
"Put J on your USB drive" is not part of a solution, though. It would
work for me, but there are lots of clueless teachers at school and they
need to be able to plug in their USB drive and click the icon on their
machine to start my app. The app MUST be on a shared disk and J must
come from the school computer, NOT the USB drive.
Henry
Dan Bron wrote:
> Henry,
>
> I haven't followed this thread closely, but you can install J (and all your
> J code, both general utilities and application) on the USB drive itself.
> Then you run it directly from the drive, rather than trying to have the
> hard-drive installation of J "find" the scripts on the USB drive.
>
> I did this for years on CDs; we'd capture a day's worth of trading
> activity in JMF files, and copy the files, the application, the utility
> scripts, and the entire J installation onto a CD (using an automated
> script), along with a batch file that ran everything from its working
> directory (using %CD%).
>
> This method allowed us to avoid the problem of trying to reload old data or
> scripts in newer (possibly incompatible) versions of J. We were able to
> identically reproduce the application as it was running on its trading
> day, with all its trade data and code, for reporting, auditing, debugging,
> backtesting, etc purposes.
>
> However, I understand your situation is slightly more complex:
>
>> above is incompatible with Edit|Configure|Folders
>
> I, like Oleg, recommend you put your scripts under the J installation
> (here, on the USB drive), so that you *can* use relative paths. You can
> then use Edit|Configure|Folders to register your zip folder with that
> relative path (prefix the folder destination with ~, which means "relative
> to my J root"), something like Name:"zip" and Folder:"~user\zip". Would
> that work for you?
>
> If not, and you're willing fiddle with the standard library a little bit,
> here's another approach you can take. Use Edit|Configure|Folders to
> register your zip folder with the absolute path X:\path\to\your\scripts .
> Literally use the "X:" instead of a real drive letter (I hope you don't
> use an X: drive [1]), as in Name:"zip" and Folder:"X:\blah\blah\zip".
>
>
> ( (2{.BINPATH) , 2&}. )"_^:('X:' -: 2&{.)
>
> Then modify ~system\extras\util\cfgread.ijs to resolve "X:" to the USB
> drive letter (i.e. where J is installed & running from); specifically the
> 2nd to last line of the function cutfolders (the 26th line of the file)
> from:
>
> pth=. deb each (ndx+1) }.each j
>
> to
>
> pth=. ( (2{.BINPATH) , 2&}. )"_^:('X:' -: 2&{.) deb each (ndx+1)
> }.each j
>
> which will replace any "X:"s with the actual drive J is running from,
> according to BINPATH , which is a special, executable-set variable
> identifing J's binary directory. Or you could do the old MYFILENAME =.
> (4!:3'') {::~ 4!:4{.;:'cutfolders' and replace BINPATH with MYFILENAME
> .
>
> Now you just have to figure out how to give the user a shortcut & icon that
> points to an application (batch file) on a unknown drive....
>
> -Dan
>
> [1] Of course, if you do already use X: you could select another, unused
> drive letter as a placeholder. I just picked X: because X looks like a
> variable.
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm