Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updater fails if not run as admin, even on a user installation #56

Closed
3 tasks done
marczellm opened this issue Feb 4, 2018 · 21 comments
Closed
3 tasks done

Updater fails if not run as admin, even on a user installation #56

marczellm opened this issue Feb 4, 2018 · 21 comments

Comments

@marczellm
Copy link

Bug report

My check list

  • latest package versions are installed
  • MiKTeX log files are attached
  • the bug can be reproduced by anybody (necessary input files are attached)

What I tried to do

Update MiKTeX with the GUI updater

What I expected to happen

Update succeeds.

What happened instead

miktex1

End of log:

2018-02-04 22:23:48,355+0100 INFO  FileCopyPage - extracting files from miktex-pdftex-bin-x64-2.9.tar.lzma...
2018-02-04 22:23:49,942+0100 ERROR update.core - The executed process did not succeed.
2018-02-04 22:23:49,942+0100 ERROR update.core - The executed process did not succeed.
2018-02-04 22:23:49,942+0100 ERROR update.core - Data: fileName="D:\Program Files\MiKTeX\miktex/bin/x64\initexmf.exe", exitCode="1"
2018-02-04 22:23:49,942+0100 ERROR update.core - Data: fileName="D:\Program Files\MiKTeX\miktex/bin/x64\initexmf.exe", exitCode="1"
2018-02-04 22:23:49,942+0100 ERROR update.core - Source: Libraries\MiKTeX\Core\Process\Process.cpp:166
2018-02-04 22:23:49,942+0100 ERROR update.core - Source: Libraries\MiKTeX\Core\Process\Process.cpp:166
2018-02-04 22:23:49,942+0100 INFO  FileCopyPage - 
2018-02-04 22:23:49,942+0100 INFO  FileCopyPage - Error: The executed process did not succeed.

Strangely if I run the updater as admin, it succeeds without error. This is weird because I don't have a system-wide MiKTeX installation, only a user installation.

The other weird thing is that no matter how many times I run the updater, it always finds these two "to be repaired" tasks:
miktex2

@edocevoli
Copy link
Member

"D:\Program Files\MiKTeX" indicates a shared installation. And besides that, modifying the "Program Files" folder usually requires admin privileges.

@marczellm
Copy link
Author

Dear Christian,

"The" Program Files directory is located at C:\Program Files.

The D:\Program Files directory was created by me and it's a perfectly regular directory. No admin privileges required.

My installation is not a shared install.

@edocevoli
Copy link
Member

You haven't attach the log files (the update log is not enough), so it's difficult to get an idea about your setup. All I can say at the moment is that I cannot reproduce your problem when going the standard setup route.

@marczellm
Copy link
Author

marczellm commented Feb 5, 2018 via email

@edocevoli
Copy link
Member

edocevoli commented Feb 5, 2018

The log files are in miktex\log (relative to the user root directory). Try %LOCALAPPDATA%\MiKTeX\2.9\miktex\log.

@edocevoli edocevoli reopened this Feb 5, 2018
@marczellm
Copy link
Author

marczellm commented Feb 5, 2018 via email

@edocevoli
Copy link
Member

I don't know yet. It's your system. You know when it happened. You are in the position to inspect the log files. You have all the information. I have: not enough information to work on this issue effectively.

@marczellm
Copy link
Author

Here's a debug trace, I hope it's useful:


[4752] [MiKTeX] TRACE initexmf.core - going to unload file name database 4 
[4752] [MiKTeX] TRACE initexmf.core - accessing file C:\ProgramData\MiKTeX\2.9\miktex/data/le\1756f6ade37d5f870f23c05a7f81e257.fndb: NOK 
[4752] [MiKTeX] TRACE initexmf.core - accessing directory C:\ProgramData\MiKTeX\2.9\miktex/data/le: OK 
[4752] [MiKTeX] TRACE initexmf.core - opening file C:\ProgramData\MiKTeX\2.9\miktex/data/le\1756f6ade37d5f870f23c05a7f81e257.fndb (1 0x2 3 0) 
[4752] [MiKTeX] TRACE initexmf.core - accessing directory C:\ProgramData\MiKTeX\2.9\miktex\data\le: OK 
[4752] [MiKTeX] TRACE initexmf.core - fndb creation completed 
[4752] [MiKTeX] TRACE initexmf.core - accessing file C:\ProgramData\MiKTeX\2.9\miktex/config\miktex.ini: NOK 
[4752] [MiKTeX] TRACE initexmf.core - MIKTEX_INITEXMF_CORE_NOREGISTRY => null 
[4752] [MiKTeX] TRACE initexmf.core - MIKTEX_MIKTEX_CORE_NOREGISTRY => null 
[4752] [MiKTeX] TRACE initexmf.core - MIKTEX_CORE_NOREGISTRY => null 
[4752] [MiKTeX] TRACE initexmf.core - MIKTEX_NOREGISTRY => null 
[4752] [MiKTeX] TRACE initexmf.core - [Core]NoRegistry => null 
[4752] [MiKTeX] TRACE initexmf.core - RegCreateKeyExW (FFFFFFFF80000002, "Software\MiKTeX.org\MiKTeX\2.9\Core") 
[4752] [MiKTeX] ERROR initexmf.core - Access is denied. 
[4752]  
[4752] [MiKTeX] ERROR initexmf.core - Access is denied. 
[4752]  
[4752] [MiKTeX] ERROR initexmf.core - Function: RegCreateKeyExW 
[4752] [MiKTeX] ERROR initexmf.core - Function: RegCreateKeyExW 
[4752] [MiKTeX] ERROR initexmf.core - Result: 5 
[4752] [MiKTeX] ERROR initexmf.core - Result: 5 
[4752] [MiKTeX] ERROR initexmf.core - Data: path="Software\MiKTeX.org\MiKTeX\2.9\Core" 
[4752] [MiKTeX] ERROR initexmf.core - Data: path="Software\MiKTeX.org\MiKTeX\2.9\Core" 
[4752] [MiKTeX] ERROR initexmf.core - Source: Libraries\MiKTeX\Core\win\winRegistry.cpp:186 
[4752] [MiKTeX] ERROR initexmf.core - Source: Libraries\MiKTeX\Core\win\winRegistry.cpp:186 
[4752] [MiKTeX] TRACE initexmf.core - MIKTEX_DEBUG_BREAK => null 
[4752] [MiKTeX] TRACE initexmf.core - uninitializing core library 
[4752] [MiKTeX] FATAL initexmf - Windows API error 5: Access is denied. 
[4752]  
[4752] [MiKTeX] FATAL initexmf - Info: path="Software\MiKTeX.org\MiKTeX\2.9\Core" 
[4752] [MiKTeX] FATAL initexmf - Source: Libraries\MiKTeX\Core\win\winRegistry.cpp 
[4752] [MiKTeX] FATAL initexmf - Line: 186 
[9484] [MiKTeX] TRACE update.core - read 690 bytes from the pipe 
[9484] [MiKTeX] ERROR update.core - The executed process did not succeed. 
[9484] [MiKTeX] ERROR update.core - The executed process did not succeed. 
[9484] [MiKTeX] ERROR update.core - Data: fileName="D:\Program Files\MiKTeX\miktex/bin/x64\initexmf.exe", exitCode="1" 
[9484] [MiKTeX] ERROR update.core - Data: fileName="D:\Program Files\MiKTeX\miktex/bin/x64\initexmf.exe", exitCode="1" 
[9484] [MiKTeX] ERROR update.core - Source: Libraries\MiKTeX\Core\Process\Process.cpp:166 
[9484] [MiKTeX] ERROR update.core - Source: Libraries\MiKTeX\Core\Process\Process.cpp:166 
[9484] [MiKTeX] INFO  FileCopyPage -  
[9484] [MiKTeX] INFO  FileCopyPage - Error: The executed process did not succeed. 

@edocevoli
Copy link
Member

The updater tries to write into the HKEY_LOCAL_MACHINE section of the registry. For that operation you need admin privileges, i.e,, you must run the updater as admin. I still don't know how to reproduce your setup and so can't give you more help here.

@marczellm
Copy link
Author

Isn't there the bug right in clear view? "The updater should never attempt to write the registry when the installation is not a system-wide install."

@marczellm
Copy link
Author

Indeed the only registry key in that location is "LastAdminMaintenance." Writing that is unnecessary when the updater is not performing admin maintenance. The updater of a user installation is never performing admin maintenance.

@edocevoli
Copy link
Member

You are absolutely right: this is a bug. But I can't reproduce the bug because I don't know how to do it. You gave me nothing to work with (no step-by-step recipe for a dummy developer).

Here is what I did:

  1. install MiKTeX as user to D:\Program Files\MiKTeX
  2. run the update wizard several times

Everything is OK. No error messages, all packages are up-to-date.

On my side, there nothing I can do to fix the bug, sorry.

@marczellm
Copy link
Author

marczellm commented Feb 6, 2018 via email

@edocevoli
Copy link
Member

Yeah, thank you for the suggestions. I promise to improve this.

@xzzh999
Copy link

xzzh999 commented May 13, 2019

I have the same problem too, when i first installed it's ok, but when i want to change it to every one share to use it, and try to reinstall it again, it always failed with exit code = 1 error.

@anooprana986
Copy link

I have the error "initexmf.exe exitcode=1".
Iam attaching the screenshot.
Screenshot (5156)

@diegoguffanti
Copy link

I have solved It.!!!
I was around one week working on this issue.
What I did?.
First of all, uninstall MIKTEX following the common steps and delete the folder found in C->Program Files.
After that:
Type: Win+R
Write: regedit
HKEY_CURRENT_USER-SOFTWARE-MIKTEX (delete this folder)
HKEY_LOCAL_MACHINE-SOFTWARE-MIKTEX (delete this folder)
HKEY_USERS-SOFTWARE-MIKTEX (delete this folder)
With these steps you delete all KEYS registered by the program during earlier installations and you can reinstall it.

@deweiwork
Copy link

Hi @diegoguffanti : I also encounter this problem today, your solution is valid for me, thanks!

@upassos
Copy link

upassos commented Sep 28, 2019

I will try it

@upassos
Copy link

upassos commented Sep 28, 2019

I will try it

Very good

@ana975
Copy link

ana975 commented Jan 12, 2020

@diegoguffanti
I had the same problem...
Where do you have to write "regedit "to find the folders that we have to delete ?

Write: regedit
HKEY_CURRENT_USER-SOFTWARE-MIKTEX (delete this folder)
HKEY_LOCAL_MACHINE-SOFTWARE-MIKTEX (delete this folder)
HKEY_USERS-SOFTWARE-MIKTEX (delete this folder)
With these steps you delete all KEYS registered by the program during earlier installations and you can reinstall it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants