I'm having problems installing LyX on Windows 7. It gets to the point of alerting me that it's going to install MiKTeX, and after I've hit OK it aborts with the following error:

No LaTeX-distribution could be found!
LyX cannot be used without a LaTeX-distribution like "MiKTeX"!
The installation will therefore be aborted.

Then, it proceeds to delete all the files it had already extracted, but hangs at deleting the LyX subfolder under Program Files (x86).

Figuring I might be able to work around this by manually installing MiKTeX, I downloaded the latest version of MiKTeX and ran that installer. Near the end of this installation, the MiKTeX Setup Wizard throws an error:

The operation could not be completed for the following reason:
Windows API error 5: Access is denied.
Details: C:\Program Files\MiKTex 2.9\miktex/bin/x64\initexmf.exe

I am logged in as an Administrator, and I've tried running both installers with Administrator rights. I've tried disabling all security software during the installation, and tried both the "all users" and "only for me" installation options.

I switched to trying the 32-bit version of MiKTeX and still got the same error. This is the end of the install log:

"C:\Program Files (x86)\MiKTeX 2.9\miktex/bin\initexmf.exe" --common-install="C:\Program Files (x86)\MiKTeX 2.9" --rmfndb --admin --log-file="C:\Program Files (x86)\MiKTeX 2.9\miktex\config\uninst.log" --verbose:

An error occurred: source file: Libraries\MiKTeX\Core\win\winProcess.cpp source line: 366 message: Windows API error 5: Access is denied.

info: C:\Program Files (x86)\MiKTeX 2.9\miktex/bin\initexmf.exe

I also tried the Registry permissions hack suggested here to no avail.

While I am (obviously) willing to try installing MiKTeX separately, I'd much rather get everything installed via the LyX bundle. I have had Lyx installed on this system previously (though it has been reformatted since), and don't recall having this much trouble.

  • The Windows installer has undergone a lot of changes recently so some bugs are being worked out. Perhaps the bug you are experiencing is related to lyx.org/trac/ticket/8417. First try uninstalling everything (any MiKTeX dist and any LyX installation you have) and download the latest Windows bundle installer from www.lyx.org. If that doesn't work, please post a bug report at www.lyx.org/trac.
    – scottkosty
    Feb 8, 2013 at 8:30
  • @scottkosty Thanks for the information. This was originally done fresh - no pre-existing LyX or MiKTeX installation, since the last reformat of the system. I'm going to try Ivan's answer before I do any bug reporting. I did not notice any heavy CPU usage as described in the ticket you reference, but it did give a good reminder to try using procmon to help trace down the issue. Thanks.
    – Iszi
    Feb 8, 2013 at 14:51
  • The Windows API error 5 is as far as I see caused by permission right issues. A search with your favorite search engines should give you some results. Also here on TeX.SE we had a question, you should read this: Windows API error 5: “Access is denied” when trying to compile TikZ picture.
    – Speravir
    Feb 8, 2013 at 20:51
  • 3
    What I found to work is to change the default folder for miktex to C:\Program Files (x86)\miktex\ instead of C:\Program Files (x86)\MiKTeX 2.9\. The installer crashes because it's probably is looking for miktex in the wrong place. This worked for me - hope it helps others.
    – Robert
    Apr 13, 2013 at 17:12
  • 5
    I don't see why this is closed! There are more than a few users of Windows 7 that are interested in using LyX. It's very frustrating to find a question that is exactly on point with a question I have but to see it closed...
    – mishaF
    Nov 19, 2013 at 18:01

1 Answer 1


It seems to me that you are trying to install the 64bit version of MiKTex. I suggest trying the 32bit instead.

If this doesn't help uninstall Adobe Reader and restart, and then install MiKTeX again.

Another possible solution is listed here:

Edit (pasted the solution from the link above)

I have got the real solution Run regedt32.exe, then navigate to HKEY_CLASSES_ROOT.pdf Rightclick .pdf, click permissions, and grant the administrator full rights.

  • Looking at this again (haven't had a chance to do any testing yet) I wonder if this answer applies at all to the problem I'm having with the LyX installer? LyX does not appear to come in 64-bit, so it would not likely be attempting to install a 64-bit version of MiKTeX. Out of curiosity, why does it matter? I'm on a 64-bit system. Is the 64-bit version just generally known to be prone to more bugs?
    – Iszi
    Feb 8, 2013 at 21:02
  • @Iszi - you posted in your question: "C:\Program Files\MiKTex 2.9\miktex/bin/x64\initexmf.exe" this is most definitely a 64bit installation. Sometimes 64bit ports have bugs that don't exist in the 32bit version.
    – Ivan P.
    Feb 9, 2013 at 1:24
  • Yes, that's from when I was manually installing MiKTeX - that's not the error generated from LyX. (See the earlier part of the question for the LyX error.) I tried un-installing Adobe Reader and still get the errors shown above. Going to try manually installing 32-bit MiKTeX next.
    – Iszi
    Feb 9, 2013 at 2:14
  • 1
    32-bit MiKTeX install failed also. Copied part of the log into the question.
    – Iszi
    Feb 9, 2013 at 2:28
  • 1
    Registry hack didn't work either.
    – Iszi
    Feb 9, 2013 at 2:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.