Code Monkey home page Code Monkey logo

Comments (11)

chrisant996 avatar chrisant996 commented on June 16, 2024 2

You could also run clink set clink.update_interval 30 to make Clink only check for updates once a month. (And if you run into some kind of problem, then check the Releases page and/or run clink update to check if a newer release fixes the problem.)

Another option is for me to publish releases less frequently. They've backed of to an average of once per week, but that's still pretty frequent. I could add an option to choose whether to install pre-release updates or release updates, and make releases infrequent. I keep thinking it's close to having releases be very infrequent, but there keeps being a slow trickle of things that need changes.

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 2

I'm working on a more automatic approach to updates.

I have a prototype in progress, where it can be configured to install updates automatically in the background if it doesn't need to elevate (i.e. if it's installed via .zip file instead of the setup exe). And if elevation is needed, then it can pop up a prompt window asking whether to install the update or skip the update or prompt again later.

I'm working on a few last kinks before it's ready for release.

from clink.

UweKeim avatar UweKeim commented on June 16, 2024 2

Thank you very much, Chris.

Actually, I've enabled clink set clink.autoupdate auto and still, my OCD (or how one calls it) just makes me want to do it anyway. Shame on me! (I'm also the guy that regularily presses Ctrl+S in Microsoft Office Word and all other application beside the fact that they do auto-save, too).

So there is really no actually meaning in me doing a clink update. I've just written my above comment to possible improve the behavior in possibly other scenarios.

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 1

I'm not comfortable with automatic forced updates for Clink, for several reasons. Especially when installed with AutoRun as the potential for conflicts is high.

But if you want to silently update Clink, you can do that with a very tiny script. It doesn't need to be built into Clink.

I'd be more likely to recommend turning off automatic check for updates, and just run clink update manually once a month.

To that end, I have been thinking of adding a flag that checks for an update without doing the update, e.g. maybe clink update --check.

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 1

@UweKeim I forgot to mention the main reason why updates require user interaction:

If you used the setup .exe installer, then updates require elevation. It's very insecure to prompt for elevation without the user directly initiating it -- it trains users to expect random elevation prompts as legitimate, which puts them at higher risk for being victims of phishing and malware attack.

Why does the installer require elevation???

  1. So that it can install Clink in Program Files, which requires elevation.
  2. So that uninstall can be performed safely and remove Clink from AutoRun for All Users. Otherwise uninstalling could break all CMD execution for all users if clink autorun --allusers install has been used (note that "all users" includes the OS itself when running processes internally as LocalSystem!).

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 1

...and OOPS, the help text for the clink update command still talks about "automatic updates" and still claims "If [an update] is available, it is downloaded and will be installed the next time Clink is injected". But that is not how it actually works -- that text is leftover from when I had originally made updates be automatically installed, and quickly realized why that can't work. I missed removing it.

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 1

BTW: Any donation button or something like that available?

Thank you for asking, but nope -- I don't accept donations at this time. 🙂

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 1

I see. You're using clink update to check for an update, instead of to apply an update. That wasn't how I'd intended/imagined for it to be used.

But it seems reasonable to use it that way. Presumably you've disabled the automatic checks for updates, and you're just periodically using clink update to test for updates on demand?

I understand the intent behind the suggested phrasing and smiley face, but I can't quite go there: a user can have multiple copies of Clink installed, and each one needs to get updated separately. So saying "everything is up to date" can be a misleading overstatement. I won't use emoji, because they only work in certain terminals -- for example the default conhost and ConEmu and ConsoleZ cannot render emoji.

I'll look into changing the design so that it doesn't assume the intent of clink update is to apply an update that has already been advertised to the user, and that it may instead be used to test for existence of updates.

P.S. Also, it's ambiguous: should the exit code be 1 because it failed to update because an update wasn't available? Or 0 because there wasn't an update? I think the color should match the exit code. Complicated...

from clink.

chrisant996 avatar chrisant996 commented on June 16, 2024 1

@UweKeim It's not a simple as just changing the text or color or exit code. Currently the design is that success means apply an update, and failure means don't. To make a "success but don't apply an update" state, I will have to do a somewhat significant redesign of the updater, and either do some significant refactoring or bubble more detailed directives up and down through the layers in the updater.

I'll put it on the todo list, but it's low priority and may take a while. Sorry, that kind of usage wasn't on my mind when I designed the updater. It was designed as a command you run once you've been notified that an update is available. There are a lot of things that have to change in order to make it behave the way you expected, and it will also be a breaking change if any scripts look at the exit code from clink update. This is unfortunately not a quick or simple task.

Out of curiosity, can you share what is the usage scenario? Is there a reason not to use clink set clink.update_interval 1 and clink set clink.autoupdate auto (or clink set clink.autoupdate prompt)? That combination would make Clink automatically check for an update once per day and also automatically apply an update if available.

from clink.

UweKeim avatar UweKeim commented on June 16, 2024

Thank you very much for your replies, @chrisant996. Sounds all completely logical to me.

I'm very happy to use your clink on a daily basis on quite a number of machines. Always happy to see a new update being installed 🙂

BTW: Any donation button or something like that available?

from clink.

UweKeim avatar UweKeim commented on June 16, 2024

Just some nitpicking:

Calling clink update results in:

No update available; local version v1.5.6 is not older than latest release v1.5.6.

While this is correct and tells me that I'm up to date, it is actually shown in red text, and also says "No...".

image

Red usually means "danger"/"error". "No" usually means an error, too.

How about changing the text to something positive in green?

Everything is up to date! Your local version v1.5.6 is the most recent release 😊

Instantly recognizable:

image

This would help me detecting quicker that there is no error but this is actually a good result.

from clink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.