Discussion:
[MiKTeX] Suggestion for Win O/S: MIKTEX_BIN environment variable
STF
2013-10-31 16:52:34 UTC
Permalink
Hi,

I installed MiKTeX in conjunction with EqualX but I have found that
installation in 64-bit Windows O/S is pretty hair-tearing because of MiKTeX
executable folder location.

If I use the 32-bit setup, MiKTeX is installed to directory
C:/Program Files *(x86)*/MiKTeX 2.9/...

If I use the 64-bit setup, "bin" folder has a subfolder called "x64" and
the whole path to executables should be
C:/Program Files/MiKTeX 2.9/miktex/bin/*x64/*...

In either case, EqualX is lost and cannot find the correct path to exe
files. And we have to manually change them in Preferences.

So I would like to give a little suggestion: MiKTeX Setup defines an
environment variable called MIKTEX_BIN pointing to the exact bin path. That
would be
C:\Program Files\MiKTeX 2.9\miktex\bin\ for 32-bit version on
32-bit O/S;
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\ for 32-bit version on
64-bit O/S;
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\ for 64-bit version.

This variable will not only be useful to EqualX (once they are aware of its
existence) but it can be very useful to other programs relying on MiKTeX.
Even MiKTeX itself can be take advantage of it. For example, setup could
rewrite PATH variable in this form:
path=path;%MIKTEX_BIN%

And it's easier to remove it from PATH during uninstallation.
Jerry
2013-10-31 17:47:18 UTC
Permalink
On Thu, 31 Oct 2013 17:52:34 +0100
Post by STF
Hi,
I installed MiKTeX in conjunction with EqualX but I have found that
installation in 64-bit Windows O/S is pretty hair-tearing because of
MiKTeX executable folder location.
If I use the 32-bit setup, MiKTeX is installed to directory
C:/Program Files *(x86)*/MiKTeX 2.9/...
If I use the 64-bit setup, "bin" folder has a subfolder called "x64"
and the whole path to executables should be
C:/Program Files/MiKTeX 2.9/miktex/bin/*x64/*...
In either case, EqualX is lost and cannot find the correct path to exe
files. And we have to manually change them in Preferences.
So I would like to give a little suggestion: MiKTeX Setup defines an
environment variable called MIKTEX_BIN pointing to the exact bin
path. That would be
C:\Program Files\MiKTeX 2.9\miktex\bin\ for 32-bit version on
32-bit O/S;
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\ for 32-bit version
on 64-bit O/S;
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\ for 64-bit version.
This variable will not only be useful to EqualX (once they are aware
of its existence) but it can be very useful to other programs relying
on MiKTeX. Even MiKTeX itself can be take advantage of it. For
path=path;%MIKTEX_BIN%
And it's easier to remove it from PATH during uninstallation.
I have installed MiKTeX 64bit on a Win 8.1 PC and then installed both
32 and 64 bit programs that have no problem with it. I would suggest
that the problem is with "EqualX". The "EqualX" web page on SourceForge
links to the 32bit MiKTeX installer. I would strongly suggest
submitting a bug report to the "EqualX" site explaining that it is not
capable of discovering the correct paths on a 64bit Windows machine. I
am assuming that you did install MiKTeX prior to installing EqualX. If
not, I would suggest that you remove EqualX from your system and then
re-install it.
--
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__________________________________________________________________
Lieberman's Law:
Everybody lies, but it doesn't matter since nobody listens.
STF
2013-10-31 18:14:38 UTC
Permalink
Post by Jerry
On Thu, 31 Oct 2013 17:52:34 +0100
I have installed MiKTeX 64bit on a Win 8.1 PC and then installed both
32 and 64 bit programs that have no problem with it. I would suggest
that the problem is with "EqualX".
I didn't say the opposite -- the problem is indeed in EqualX (or any other
future softwares relying on MiKTeX) which has (and will have) a hard time
to find the correct path.
Post by Jerry
The "EqualX" web page on SourceForge
links to the 32bit MiKTeX installer. I would strongly suggest
submitting a bug report to the "EqualX" site explaining that it is not
capable of discovering the correct paths on a 64bit Windows machine.
It was done already.
Post by Jerry
I am assuming that you did install MiKTeX prior to installing EqualX.
Yes
Post by Jerry
If not, I would suggest that you remove EqualX from your system and then
re-install it.
But I'm using a 64-bit OS and default settings of EqualX didn't work. It
took me some time to figure out why EqualX didn't work.

But it doesn't hurt to declare a variable to make things clearer for
everybody. That is more than profitable for everyone.
Jerry
2013-10-31 18:30:12 UTC
Permalink
On Thu, 31 Oct 2013 19:14:38 +0100
Post by STF
Post by Jerry
On Thu, 31 Oct 2013 17:52:34 +0100
I have installed MiKTeX 64bit on a Win 8.1 PC and then installed
both 32 and 64 bit programs that have no problem with it. I would
suggest that the problem is with "EqualX".
I didn't say the opposite -- the problem is indeed in EqualX (or any
other future softwares relying on MiKTeX) which has (and will have) a
hard time to find the correct path.
Post by Jerry
The "EqualX" web page on SourceForge
links to the 32bit MiKTeX installer. I would strongly suggest
submitting a bug report to the "EqualX" site explaining that it is
not capable of discovering the correct paths on a 64bit Windows
machine.
It was done already.
Post by Jerry
I am assuming that you did install MiKTeX prior to installing EqualX.
Yes
Post by Jerry
If not, I would suggest that you remove EqualX from your system and
then re-install it.
But I'm using a 64-bit OS and default settings of EqualX didn't
work. It took me some time to figure out why EqualX didn't work.
But it doesn't hurt to declare a variable to make things clearer for
everybody. That is more than profitable for everyone.
I am not sure what installer EqualX is using. If it is using a standard
MSI installer, and it is configured correctly, then there should be no
problem. If it is using a home brewed installed or a misconfigured one,
then there are going to be problems.
--
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__________________________________________________________________
STF
2013-10-31 18:39:02 UTC
Permalink
Post by Jerry
I am not sure what installer EqualX is using. If it is using a standard
MSI installer, and it is configured correctly, then there should be no
problem. If it is using a home brewed installed or a misconfigured one,
then there are going to be problems.
Whether it's home brewed or not is irrelevant. If MiKTeX does not give any
clue of where it's installed, the other softwares just can't find where its
bin can be found unless they are *casting a wide net* and do exhausted
search on every local drives to find it, which is not very practical IMO.

Anyway, I conclude that MiKTeX is incapable to create such variable.
Forget about it if you can't do it.
Jerry
2013-10-31 20:26:28 UTC
Permalink
On Thu, 31 Oct 2013 19:39:02 +0100
Post by STF
Post by Jerry
I am not sure what installer EqualX is using. If it is using a
standard MSI installer, and it is configured correctly, then there
should be no problem. If it is using a home brewed installed or a
misconfigured one, then there are going to be problems.
Whether it's home brewed or not is irrelevant. If MiKTeX does not
give any clue of where it's installed, the other softwares just can't
find where its bin can be found unless they are *casting a wide net*
and do exhausted search on every local drives to find it, which is
not very practical IMO.
Anyway, I conclude that MiKTeX is incapable to create such variable.
Forget about it if you can't do it.
Most of that information is recorded in the "Registry". That is where
many installers look for just the information that you are talking
about. Programs like "TeXstudio" have no problem finding where MiKTeX
is hiding whether it is a 32 or 64 bit system or a 32 bit install on a
64 bit system. I can confirm that. It sounds to me like the EqualX
installer either doesn't check or is improperly configured. Again, I
have no idea what they are using for an installer.
--
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__________________________________________________________________
Give a man a fish and he will eat for a day. Teach him how to fish,
and he will sit in a boat and drink beer all day.
STF
2013-11-03 19:24:04 UTC
Permalink
Post by Jerry
Most of that information is recorded in the "Registry". That is where
many installers look for just the information that you are talking
about.
I knew that already. Well, as a matter of fact, they don't match exactly
what I was talking about. Let me ask you a question:
Did you record the bin directory in registry? I mean the path that stops
at the "\" character, something like "C:\Program Files\MiKTeX
2.9\miktex\bin\x64*\*" but nothing else?
I can answer for you, the answer is *No*.

2nd question: did you record those information in the mostly expected
registry key, ie HKEY_LOCAL_MACHINE\SOFTWARE\MiKTeX.org\MiKTeX?

Once again, I can answer for you and the answer is still *No*

Actually, if you could provide the bin path in registry, it's still better
than nothing (more on this point below) Would you consider providing it?
Post by Jerry
Programs like "TeXstudio" have no problem finding where MiKTeX
is hiding whether it is a 32 or 64 bit system or a 32 bit install on a
64 bit system. I can confirm that.
It depends on your definition of "no problem", ie that doesn't mean they
are able to do it without difficulties. I'm pretty sure they have to
*hack* one of the paths to some exe or dll file to get the path up to the
"\" character.

For example, I had found this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MiKTeX.dvi.2.9

But think about it, when MiKTeX version changes to say 3.0, their hack
would not work anymore. Well, unless they had anticipated this and cast a
"wide net" to include all possibilities for
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MiKTeX.dvi.x.y

Nevertheless, this is still a heck and personally, if I needed to program
an exhaustive search like this, I wouldn't employ the words "no problem" to
describe the work I had to provide to get to the result.
Post by Jerry
It sounds to me like the EqualX
installer either doesn't check or is improperly configured. Again, I
have no idea what they are using for an installer.
No, it has nothing to do with installer. Or at least, it is not
necessarily related to the installer -- it is a runtime config issue.

Between registry and environment variable, it's preferable to use env var.
Suppose such variable is defined:
* we don't need special function/API to get registry keys and values. In
batch files as well as in dynamic expansion, one only needs to use %xxxxxx%
and that's it! You see how convenience that is?

* Especially in batch file, AFAIK, we need to write several lines of codes
(or equivalently a long instruction) to get a value from a registry key.
And that's very prone to error. Very inconvenient.

* Using env vars is more Unix-like style

* If a program (or batch file) is using env vars dynamic expansion (ie
%xxxxxx%), users can install a newer versions of MiKTeX without fearing
that dependent programs might be broken because the var is always pointing
to the good directory and the variable is evaluated at runtime.

But once again, if you could provide registry key to the path only, it's
still good.

Loading...