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

initexmf --force --mklinks --admin fails if TeXworks is open #174

Closed
3 tasks done
moewew opened this issue Aug 2, 2018 · 6 comments
Closed
3 tasks done

initexmf --force --mklinks --admin fails if TeXworks is open #174

moewew opened this issue Aug 2, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@moewew
Copy link

moewew commented Aug 2, 2018

Checklist:

  • I am reporting a bug others will be able to reproduce
  • I have installed the latest MiKTeX updates
  • I have checked the MiKTeX log files

Since the 2018-07-28 update of MikTeX I notice that an update would fail to complete when TeXworks is opened. This did not use to happen earlier. Would it be possible to let an update succeed even if TeXworks is open?

Step-by-step instructions to reproduce

  1. Open TeXworks.

  2. Then start

    initexmf --force --mklinks --admin
    

    in an admin console.

  3. You will be met with

    Sorry, but "MikTeX Configuration Utility" did not succeed
    

    The relevant initexmf_admin.log will contain

    2018-08-02 12:47:53,644+0200 INFO  initexmf - starting: MiKTeX Configuration Utility 2.9.6713 (MiKTeX 2.9.6745 64-bit)
    2018-08-02 12:47:53,644+0200 INFO  initexmf - Operating on the shared (system-wide) MiKTeX setup
    2018-08-02 12:47:53,644+0200 INFO  initexmf - starting with command line: initexmf --force --mklinks --admin
    2018-08-02 12:47:53,818+0200 FATAL initexmf - Windows API error 183: Eine Datei kann nicht erstellt werden, wenn sie bereits vorhanden ist.
    
    2018-08-02 12:47:53,818+0200 FATAL initexmf - Info: newName="C:\Program Files\MiKTeX 2.9\miktex/bin/x64\texworks.exe", oldName="C:\Program Files\MiKTeX 2.9\miktex/bin/x64\miktex-texworks.exe"
    2018-08-02 12:47:53,818+0200 FATAL initexmf - Source: Libraries\MiKTeX\Core\File\win\winFile.cpp
    2018-08-02 12:47:53,818+0200 FATAL initexmf - Line: 403
    

I understand that MikTeX can't write on TeXworks if it is open, but I'm wondering why this used to work before and only started to become problematic a few days ago. It would really be quite nice if one could update MikTeX without having to close TeXworks.

@edocevoli
Copy link
Member

What's the name of the TeXworks, i.e., how did you start TeXworks?

@moewew
Copy link
Author

moewew commented Aug 2, 2018

I started it via the start menu link C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MiKTeX 2.9 that points to "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\miktex-texworks.exe". The task manager shows miktex-texworks.exe (path C:\Program Files\MiKTeX 2.9\miktex\bin\x64) running.

@edocevoli
Copy link
Member

Because I cannot reproduce the bug, I think that it is a system-dependent bug.

FYI: initexmf tries to install a hard link from miktex-texworks.exe to texworks.exe. This fails with Windows error 183 ("Cannot create file when that file already exists"). You can try this

  1. open TeXworks
  2. open a command-prompt windows as admin
  3. run initexmf --force --mklinks --admin

Step 3 should fail (on my system it works).

Maybe step 3 succeeds If you first delete texworks.exe.

@moewew
Copy link
Author

moewew commented Aug 2, 2018

Indeed the procedure you describe is exactly what I did to reproduce the problem. I could get step 3 to fail consistently.

I notice that in my C:\Program Files\MiKTeX 2.9\miktex\bin\x64 I have texworks.exe as well as

24.06.2018  23:40         6.065.152 texworks.exe
24.06.2018  23:40         6.065.152 texworks.exe.(old)
24.06.2018  23:40         6.065.152 texworks.exe.12668.(old)
24.06.2018  23:40         6.065.152 texworks.exe.22956.(old)
24.06.2018  23:40         6.065.152 texworks.exe.31448.(old)
24.06.2018  23:40         6.065.152 texworks.exe.36934.(old)
24.06.2018  23:40         6.065.152 texworks.exe.38338.(old)
24.06.2018  23:40         6.065.152 texworks.exe.53000.(old)
24.06.2018  23:40         6.065.152 texworks.exe.53924.(old)
24.06.2018  23:40         6.065.152 texworks.exe.58716.(old)
24.06.2018  23:40         6.065.152 texworks.exe.82.(old)

All of them seem to be locked as long as TeXworks is running. (Unfortunately, I could not find out who was blocking these files.)

I removed these files and succeeded in running initexmf --force --mklinks --admin with TeXworks closed and open.

I can quite consistently reproduce my specific issue as follows.

  1. Delete all texworks* in C:\Program Files\MiKTeX 2.9\miktex\bin\x64
  2. Open TeXworks
  3. Call initexmf --force --mklinks --admin twelve times

The twelve runs produce in that order

  1. texworks.exe
  2. texworks.exe.(old)
  3. texworks.exe.82.(old)
  4. texworks.exe.36934.(old)
  5. texworks.exe.12668.(old)
  6. texworks.exe.53000.(old)
  7. texworks.exe.38338.(old)
  8. texworks.exe.31448.(old)
  9. texworks.exe.22956.(old)
  10. texworks.exe.58716.(old)
  11. texworks.exe.53924.(old)
  12. error

Further runs produce more errors.

@edocevoli edocevoli added this to the 2.9.6800 milestone Aug 2, 2018
@edocevoli
Copy link
Member

So the trick is to repeat step 3. I was now able to reproduce it.

@edocevoli edocevoli self-assigned this Aug 2, 2018
@edocevoli
Copy link
Member

This will be fixed with milestone 2.9.6800.

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

No branches or pull requests

2 participants