Discussion:
[MiKTeX] is it possible (re-)configure the portable version of miktex so that write access to the distribution is not needed?
Rick Pember
2013-04-24 18:48:35 UTC
Permalink
Since there was some confusion, this is hopefully a clearer version of
my previous post.

We include the portable version of MikTeX in our software distribution
because we have a report generation tool that uses MikTeX as a back end.
Our users don't actually use MikTeX directly. The report generation tool
is command line only. The MikTeX executables that we use are accessed by
our report generation tool and are used in "batchmode". (BTW, we include
copyright notices, etc., for MikTeX in the distribution.)

What we did is this.

1) we downloaded the 2.9 portable version of MikTeX and installed it.

2) we ran the portable version on a tex file that downloads all the
packages to which our users need access for the report generation tool.

3) we then include the MikTeX distribution folder in our distribution.
Our report generation tool (python) executes the MikTeX executables it
needs to. Because we're using the portable version, no MikTeX
initialization or Windows registry access is needed.

This actually works except for one small feature: MikTeX's pdflatex and
latex need the files texmf.fndb and mpm.fndb (in miktex/data/le) to be
writeable by users, specifically, users with non-admin accounts. If we
make these two files writeable, this approach works without any problems.

(If they aren't writeable, errors like "pdflatex: Windows API error 5:
Access is denied" occur.)

The issue with this approach is that our customers are typically
installing our software, including the MikTeX directory, in Program
Files. Some of our customers have a security requirement that no file
in Program Files can be writeable by users. Also, these are often
multiuser environments.

It does seem from the tests I ran that texmf.fndb and mpm.fndb do not
need to be writeable if all the packages needed are already installed.
Specifically, if all the packages are already available, pdflatex and
latex do not change the contents or the time stamps of texmf.fndb and
mpm.fndb.

My question is: is there some way to re-configure the portable version
MikTeX so that write access to texmf.fndb and mpm.fndb is not needed.
Thompson,Paul
2013-04-24 18:55:10 UTC
Permalink
In fact, it is possible to provide specially repackaged binaries with everything pre-rolled into them. In your case, that might be a good thing, because you have a specific, non-moving target that you are working with. The disadvantage of the pre-set binary approach is that it is less flexible. The advantage is that it is inflexible and loads faster than usual. In your case, that is exactly what you want.

-----Original Message-----
From: Rick Pember [mailto:***@altair.com]
Sent: Wednesday, April 24, 2013 1:49 PM
To: miktex-***@lists.sourceforge.net
Subject: [MiKTeX] is it possible (re-)configure the portable version of miktex so that write access to the distribution is not needed?

Since there was some confusion, this is hopefully a clearer version of my previous post.

We include the portable version of MikTeX in our software distribution because we have a report generation tool that uses MikTeX as a back end.
Our users don't actually use MikTeX directly. The report generation tool is command line only. The MikTeX executables that we use are accessed by our report generation tool and are used in "batchmode". (BTW, we include copyright notices, etc., for MikTeX in the distribution.)

What we did is this.

1) we downloaded the 2.9 portable version of MikTeX and installed it.

2) we ran the portable version on a tex file that downloads all the packages to which our users need access for the report generation tool.

3) we then include the MikTeX distribution folder in our distribution.
Our report generation tool (python) executes the MikTeX executables it needs to. Because we're using the portable version, no MikTeX initialization or Windows registry access is needed.

This actually works except for one small feature: MikTeX's pdflatex and latex need the files texmf.fndb and mpm.fndb (in miktex/data/le) to be writeable by users, specifically, users with non-admin accounts. If we make these two files writeable, this approach works without any problems.

(If they aren't writeable, errors like "pdflatex: Windows API error 5:
Access is denied" occur.)

The issue with this approach is that our customers are typically installing our software, including the MikTeX directory, in Program Files. Some of our customers have a security requirement that no file in Program Files can be writeable by users. Also, these are often multiuser environments.

It does seem from the tests I ran that texmf.fndb and mpm.fndb do not need to be writeable if all the packages needed are already installed.
Specifically, if all the packages are already available, pdflatex and latex do not change the contents or the time stamps of texmf.fndb and mpm.fndb.

My question is: is there some way to re-configure the portable version MikTeX so that write access to texmf.fndb and mpm.fndb is not needed.


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
MiKTeX-Users mailing list
MiKTeX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/miktex-users
-----------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and may contain
privileged and confidential information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy
all copies of the original message.
Ulrike Fischer
2013-04-25 08:23:18 UTC
Permalink
Post by Rick Pember
Since there was some confusion, this is hopefully a clearer version of
my previous post.
We include the portable version of MikTeX in our software distribution
because we have a report generation tool that uses MikTeX as a back end.
Our users don't actually use MikTeX directly. The report generation tool
is command line only. The MikTeX executables that we use are accessed by
our report generation tool and are used in "batchmode". (BTW, we include
copyright notices, etc., for MikTeX in the distribution.)
What we did is this.
1) we downloaded the 2.9 portable version of MikTeX and installed it.
2) we ran the portable version on a tex file that downloads all the
packages to which our users need access for the report generation tool.
3) we then include the MikTeX distribution folder in our distribution.
Our report generation tool (python) executes the MikTeX executables it
needs to. Because we're using the portable version, no MikTeX
initialization or Windows registry access is needed.
This actually works except for one small feature: MikTeX's pdflatex and
latex need the files texmf.fndb and mpm.fndb (in miktex/data/le) to be
writeable by users, specifically, users with non-admin accounts. If we
make these two files writeable, this approach works without any problems.
Access is denied" occur.)
I couldn't reproduce this problem. I downloaded miktex portable on a
stick, made the two fndb non writable and then compiled without
problem a small test file with pdflatex. I check that the files are
really non-writable by triggering the on-the-fly installation: then
I get an error that the database is non-writable.

But things could be different if the installation is not on a stick
but in program files.


I also tried to change the location of the miktex-maintained roots:

I created a folder localtexmf beside miktex-portable.

I started miktex-portable.cmd and in the menu miktex options and
added localtexmf as new root.

Then I opened miktexstartup.ini in miktex\config and changed the
path section to

[Paths]

;; user TEXMF root directories
UserRoots=..\..\..\localtexmf
UserInstall=..\..\..\localtexmf
UserData=..\..\..\localtexmf

pdflatex then installed new packages installed on the fly in
localtexmf. Perhaps such a configuration works for you too (you can
also try to change the location of other miktex maintained roots
like UserConfig or CommonConfig).

This approach is a bit unstable: If I change miktexstartup before
starting miktex-portable.cmd I don't get the icon in the task bar.
But as your user don't need a menu this perhaps doesn't matter.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Richard Pember
2013-04-26 03:28:27 UTC
Permalink
Christian Schenk responded with several suggestions, including:

1) use the basic installer instead of the portable one and specify a
separate folder for data. I ran

basic-miktex-2.9.4813-x64 --common-install=c:\miktex
--common-data=c:\miktex_data --no-registry

2) to move MikTeX, modify miktexstartup.ini in miktex\config to account
for the new location (You suggested this as well.):

For example
------------------------------------------------------------
;;; MiKTeX startup information

[Paths]

;; common install root
CommonInstall=C:\miktex2

;; common data root
CommonData=c:\miktex2_data
-------------------------------------------------------------

This approach does what I need.

These two steps were the key.
Post by Ulrike Fischer
Post by Rick Pember
Since there was some confusion, this is hopefully a clearer version of
my previous post.
We include the portable version of MikTeX in our software distribution
because we have a report generation tool that uses MikTeX as a back end.
Our users don't actually use MikTeX directly. The report generation tool
is command line only. The MikTeX executables that we use are accessed by
our report generation tool and are used in "batchmode". (BTW, we include
copyright notices, etc., for MikTeX in the distribution.)
What we did is this.
1) we downloaded the 2.9 portable version of MikTeX and installed it.
2) we ran the portable version on a tex file that downloads all the
packages to which our users need access for the report generation tool.
3) we then include the MikTeX distribution folder in our distribution.
Our report generation tool (python) executes the MikTeX executables it
needs to. Because we're using the portable version, no MikTeX
initialization or Windows registry access is needed.
This actually works except for one small feature: MikTeX's pdflatex and
latex need the files texmf.fndb and mpm.fndb (in miktex/data/le) to be
writeable by users, specifically, users with non-admin accounts. If we
make these two files writeable, this approach works without any problems.
Access is denied" occur.)
I couldn't reproduce this problem. I downloaded miktex portable on a
stick, made the two fndb non writable and then compiled without
problem a small test file with pdflatex. I check that the files are
really non-writable by triggering the on-the-fly installation: then
I get an error that the database is non-writable.
But things could be different if the installation is not on a stick
but in program files.
I created a folder localtexmf beside miktex-portable.
I started miktex-portable.cmd and in the menu miktex options and
added localtexmf as new root.
Then I opened miktexstartup.ini in miktex\config and changed the
path section to
[Paths]
;; user TEXMF root directories
UserRoots=..\..\..\localtexmf
UserInstall=..\..\..\localtexmf
UserData=..\..\..\localtexmf
pdflatex then installed new packages installed on the fly in
localtexmf. Perhaps such a configuration works for you too (you can
also try to change the location of other miktex maintained roots
like UserConfig or CommonConfig).
This approach is a bit unstable: If I change miktexstartup before
starting miktex-portable.cmd I don't get the icon in the task bar.
But as your user don't need a menu this perhaps doesn't matter.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
MiKTeX-Users mailing list
https://lists.sourceforge.net/lists/listinfo/miktex-users
Loading...