This is a software question, specific to MiKTeX: I have automatic downloading of packages enabled, so that if I try to use a style that's not in the existing directory trees, it is downloaded from CTAN and installed. The problem is that MiKTeX installs it under %APPDATA% (at C:\Documents and Settings\<user>\Application Data\MiKTeX\2.9), which bloats my roaming profile. Is there a way to change this destination?

I already have another root for styles I install myself, but I can't get MiKTeX to use it for auto-installed packages. In the Roots list in MiKTeX Settings (mo.exe), the %APPDATA% folder has the tag "UserInstall". It won't let me edit or delete its path, or tag another root "UserInstall". Is there a way to do this, or am I stuck with rearranging the downloaded packages by hand afterwards?

  • 1
    I don't think that you can change UserInstall in a running miktex but it is possible to set it at installation time: docs.miktex.org/2.9/manual/setupwiz.html Nov 12 '12 at 12:44
  • I'm guessing this setting can probably be changed by editing the registry... but it was easy enough to re-install.
    – alexis
    Nov 12 '12 at 14:28
  • Additional tip for a re-installation: Relocate MiKTeX 2.9?.
    – Speravir
    Nov 12 '12 at 15:34
  • You could use Ulrike’s and my information and provide a self answer.
    – Speravir
    Nov 12 '12 at 17:08

As Ulrike explained in the comments above, it seems that MikTeX allows the UserInstall directory to be configured only during installation. So, it's easiest to just re-install it, calling the installer from the commandline with suitable options. The full set of commandline options for the installer is documented here.

I first removed the existing MikTeX by running the uninstaller from the Start menu. I then opened a command prompt (this is on Windows), switched to the directory containing the downloaded installer, and ran the following:

C:\...> basic-miktex-***.exe --shared --user-install="C:\Path\to\my\root"

I used --shared since it's being installed for all users, but I was asked again during the set-up dialog anyway. There are also options --user-config and --user-data (I don't mind leaving those in the default location).

I am just setting up a new computer, so this was a no-brainer. I follow best practices and keep all style files that are not managed by MikTeX in a separate texmf hierarchy, so there was no need to salvage anything before uninstalling. But if you have been dropping your non-CTAN styles into the MikTeX texmf tree (definitely not a good idea), or have a huge texmf tree and a slow internet connection, or use your computer off-line a lot and don't want to be surprised by missing packages, you can follow this procedure, which lets you use your old texmf tree as the data source for the new installation (thanks @Speravir for the pointer).


As opposed to what the accepted answer says, it not "easier" to reinstall. One can make a simple edit in the registry: the install dir for packages is set on HKEY_LOCAL_MACHINE\SOFTWARE\MiKTeX.org\MiKTeX\2.9\Core\UserInstall

  • Good information, thanks! This would definitely be the way to go for an older installation (for which wiping and recreating would trigger unnecessary downloads, and possibly incompatibilities). For completeness: The registry is edited by running regedit from the CMD prompt, right?
    – alexis
    Jan 24 '16 at 13:04
  • 1
    Yes, with an administrator account. Jan 24 '16 at 13:57
  • Riight, administrator account. Forgot about all that. Not sure what happens on a roaming profile in a University environment (my use case), where I have limited admin rights. But fortunately, I don't personally need to try this anymore. :-)
    – alexis
    Jan 24 '16 at 14:52
  • There's no UserInstall in the Registry on my PC (Win 10, MiKTeX 2.9)
    – Arnaud
    Feb 17 '17 at 16:50
  • UserInstall might not be present in HKEY_CURRENT_USER, but might be in HKEY_LOCAL_MACHINE May 22 '20 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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