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

clink update hangs after elavating permissions #503

Closed
jtnord opened this issue Oct 2, 2023 · 3 comments
Closed

clink update hangs after elavating permissions #503

jtnord opened this issue Oct 2, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@jtnord
Copy link
Contributor

jtnord commented Oct 2, 2023

clink showed an update from 1.5.5 to 1.5.7.

running clink update prompts for elevation, but the subsequent window just hangs with Checking latest version...

logs show

7bbc ={update.lua}               0 Clink updater: latest release is v1.5.7; install type is zip.
7bbc ={update.lua}               0 Clink updater: update in C:\Users\me\AppData\Local\Temp\clink\updater\v1.5.7.zip is ready to be applied.
7bbc ={update.lua}               0 Clink updater: expanding C:\Users\me\AppData\Local\Temp\clink\updater\v1.5.7.zip into C:\Users\jnord\AppData\Local\Temp\clink\updater\v1.5.7.
7bbc ={update.lua}               0 Clink updater: Permission denied; failed to install file 'CHANGES'.
2498 ={update.lua}               0 Clink updater: latest release is v1.5.7; install type is zip.
2498 ={update.lua}               0 Clink updater: update in C:\Users\myadmin\AppData\Local\Temp\clink\updater\v1.5.7.zip is ready to be applied.
@chrisant996 chrisant996 added the bug Something isn't working label Oct 2, 2023
@chrisant996
Copy link
Owner

chrisant996 commented Oct 2, 2023

@jtnord Thanks for reporting this.

Can you confirm that you had changed clink.autoupdate to either auto or prompt?
Update: But per #504, maybe you haven't changed clink.autoupdate and instead you're getting hit by the bug where it's accidentally behaving as though it's set to auto?

I'm pretty sure it has to be this line in update.lua, which was added by 8bb76c0 in v1.5.5 as part of the new auto and prompt modes of the clink.autoupdate setting:

if not clink._acquire_updater_mutex() then

You should be able to work around the problem by running clink set clink.autoupdate clear to reset it to the default mode of checking and just printing a message.

But I'm not able to reproduce the hang. I installed v1.5.5 with "enhanced defaults" and "autorun", ran clink set clink.autoupdate auto, ran cmd and got a message about a v1.5.7 update being available followed by a popup window asking if I want to update now. I chose to update now, it asked for elevation, and it successfully installed.

I'll try to figure out how to reproduce the hang.

@chrisant996
Copy link
Owner

@jtnord I figured out how to repro:

  1. Run clink set clink.autoupdate auto.
  2. Start cmd.exe, and it pops up a "Clink Update" prompt window.
  3. Start another cmd.exe before making a choice in the "Clink Update" prompt window.
  4. Now choose "Update now" in the "Clink Update" prompt window.
  5. Hang.

I'll work on a fix. It might take a couple of days.

In the meantime you can either:

  1. Run clink set clink.autoupdate clear to turn off the automatic updating.
  2. Don't start more cmd.exe processes while the "Clink Update" prompt window is waiting for a choice.

@chrisant996
Copy link
Owner

v1.5.8 has been published with the fix.

Starting when updating from v1.5.8 to a future version, this problem will no longer occur. But it can still occur when updating to v1.5.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants