[dev-context] Enviromental variables in MikTeX

Mojca Miklavec mojca.miklavec.lists at gmail.com
Sat Jun 3 11:47:07 CEST 2006

Hello (Hans),

in MikTeX almost no environmental variables are set. Consequently some
basic operations such as "ctxtools --update", "texexec --make --all",
... don't work. (ConTeXt doesn't know where to put the extracted
downloaded files, where put the formats, ...)
texexec does all kinds of trickery on many places, including
MikTeX-dependent behaviour, but doesn't address this problem yet. If I
ignore the lack of interest to support ConTeXt on the MikTeX side,
some things could be improved on ConTeXt side as well.

So: Would it be possible to set some basic environmental variables
somewhere at the beginning, so that the "basic" functionality would be
there for MikTeX as well? I tried to use the code below, but the
problem is that I have no idea how to make changes to environmental
variables global (the following code only changes it locally according
to ruby documentation).

somewhere around line 270 in kpse.rb:

    if Kpse.miktex? then
        # sets the TEXMFLOCAL according to the location of context.tex
        # although a bit of cheating, it should work in 99.5% cases
        ENV['TEXMFLOCAL'] =
run("context.tex").gsub(/\/tex\/context\/base\/context.tex$/, '')

If this worked, other environmental variables could be set in a
similar manner as well. (Another stupid part is that it would probably
be necessary to distinguish between version 2.4 and 2.5 (which behave
completely different and have different directory structure) in some
parts, but that's already another story.) But at least ConTeXt (only
the ruby version) now works with MikTeX 2.5.

Thanks a lot,

PS: one very strong reason why I currently use MikTeX is that metapost
keeps crashing with the stand-alone distribution. It is sometimes very
helpful to have both distros installed and use the one that works
better for the particular task.

More information about the dev-context mailing list