-
Notifications
You must be signed in to change notification settings - Fork 148
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
After updating with "clink update" you still see an update when you run "winget upgrade" #306
Comments
I do understand the problem. But the suggested solution of always forcing install via the installer would create many problems. What about when people installed Clink from a zip file in the first place? What about when there are multiple installs of Clink on the same computer? And so on. These are the kinds of reasons why I had not created an update command yet. So, no, that's not a solution at all. What I can potentially do is make the updater check if the setup exe has ever been used on the computer, and whether the copy that's being updated is the same location where the setup exe installed it, and if so then also update registry entries about what version was installed. If winget is using the setup exe's registry keys to figure out the version -- versus winget keeping track of the installed version and assuming that only winget installs updates. May I ask, why would someone try to update Clink using multiple mechanisms? Why not turn off Clink's updater, if an external updater is preferred? |
Anti-malware protection blocks launching the downloaded setup exe. I think the best solution is this: If you're going to use an external updater program, then don't use Clink's built in updater. |
ok, I was a bit confused. I run this |
Furthermore, it seems that winget is looking at its own internal database of what it installed. The most that Clink can do is overwrite the DisplayVersion regkey. |
will this prevent showing an clink update in winget after doing the intool update? |
Maybe. I can't predict one way or the other. It would depend on how winget determines what versions it thinks are installed. |
I found this statement:
|
That is non-specific and doesn't clarify where winget looks, what API calls it uses, what information source the data comes from, nor how that information source gets the relevant data stored into it. But I should be clear: I have no intention of trying to "support" winget if it uses a custom database or if it looks at anything other than regkeys directly set by the Clink setup program. If it does, then it'll work. If it doesn't, then Clink can't do anything about that. And it doesn't really make sense to be trying to use multiple different updaters for the same program. Pick one. 🙃 |
There is no custom database for determining which version of a package is installed. It's all driven by registry keys. There is a database to record packages that have been installed, but it's purely for attempting to improve correlation between installed packages and manifests available in configured sources. The Windows Package Manager doesn't assume the package hasn't been modified with some other mechanism. With a cursory glance at the versioning scheme used here, there may be challenges determining if an upgrade is available if the fourth position isn't necessarily incremental. I've seen several examples where commit hashes or some other non-sequential value is a part of a version number. I certainly didn't dig in and look, it's just a superficial observation. |
@denelon Thanks for the confirmation! I think you’re saying that The original author of Clink embedded a commit hash in the fourth value, and I haven’t removed it yet because I don’t know all the potential side effects. He’d been using it for several purposes, including attempting to work around a race condition in the NSIS installer. The first time I removed the hash from someplace, it caused a regression. I’m cautious about removing it from other places, now. 😉 For builds of Clink published on github, the hash is never a functional part of the version. I.e. there will never be two version numbers that differ only by hash. So far, winget hasn’t seemed to have any problems comparing version numbers for Clink, probably because the hashes aren't a functional "identifier" part of the version number. |
My pleasure. Yes, you are correct. I totally get the commit hash as a part of the identifier and as long as the hashes aren't a functional part of the version number, there shouldn't be any conflict to resolve. |
@denelon apparently as reported in #434, winget does not successfully compare version numbers for Clink, at least not anymore. Clink publishes its version numbers as It seems something in winget is presumably parsing the file names, and it is inaccurately thinking that the published version number is I'm not sure how to change the automated winget stuff to parse the version correctly. Any thoughts on how to fix how winget comes up with the available version number? P.S. I'm pretty sure I didn't add Clink into winget, and it looks as though something is automatically generating manifests. Interestingly, it seems to have gotten the version number correct for 1.4.18, but all other versions seem to be wrong. |
@vedantmgoyal2009 can you take a look at this? @chrisant996 there are a few options for maintaining and publishing the manifest yourself as well. PowerToys and Oh My Posh have GitHub actions using wingetcreate. |
It looks like part of the problem is that there were incorrect Product Code mappings in many of the manifests over on winget-pkgs. I've submitted PR's to fix that issue. The other issue is that Primary Issue:
|
Thanks, @Trenly, I'll independently confirm your observations and report back. Offhand they look both accurate and highly informative and helpful. I was unaware that a "product code" even existed. I'm happy to modify There is long-standing precedent for being able to have multiple different versions of Clink installed side-by-side. I certainly could remove that ability and use a single product code. But I worry that might break things for some people. It seems that the SxS ability was introduced as a side effect of trying to work around a race condition in the installer due to a bug in the .nsi file. But regardless how it came into being, the SxS ability exists. Removing the ability opens up regression risk for some users. EDIT: ...oh but winget doesn't really understand/support SxS does it? Interesting... So, I will also investigate making changes to Thanks again, this was very helpful and educational for me! ❤ |
Thanks, @denelon -- I like that the PowerToys one uses .Trim to transform the release tag. I'll model mine after that version. Very helpful, thank you! |
@chrisant996 - I wasn't able to get SxS working on my end, either by using Using the installer, this section will always uninstall previous versions anyways - Lines 94 to 118 in 236abad
|
@Trenly Yes, you're right -- the installer has never actually supported SxS. When "installing" manually by extracting from a .zip file, it has always been possible to have multiple versions of Clink installed. So maybe this will all be very easy and straightforward to clean up. 🤞 And denelon pointed me to the PowerToys workflow for updating winget, and I'll hook up a variation of that for Clink. Do you happen to know whether I need to do anything additional to make the bot stop auto-creating updated packages for Clink? |
I'll submit a PR over on Vedant's automation |
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
Well, I guess I'm too late here, and Trenly already gave the answer 😅
(although, it is highly unlikely that one will prefer a community solution over an official solution, still posting it here 😶🌫️) WinGet Releaser, a GitHub Action, also helps you to publish new releases to WinGet. |
Options are always good @vedantmgoyal2009 😊 |
@Trenly How did you determine that If the current Clink being used was installed via the .exe installer, then Did you find a repro where Clink was installed by the .exe installer, but Line 711 gets the current installation type. When installed via the .exe installer, it returns "exe". In my testing, that seems to be working correctly. Line 718 refuses to continue unless the downloaded update type (zip or exe) matches the current installation type (zip or exe). Lines 722-723 run the .exe installer to perform an update if Clink was installed via the .exe installer. (I'm actually not sure why the .zip updater is fiddling with registry keys at all... I think that's a carryover from before it knew how to download+run the .exe installer.) clink/clink/app/scripts/update.lua Lines 711 to 726 in 3563f62
|
@Trenly what should I expect C:\Users\chrisant>winget --version
v1.4.10173 This much is accurate: C:\Users\chrisant>winget list | findstr clink
Clink v1.4.16.b8efc4 clink_1.4.16.b8efc4 1.4.16.b8efc4 But what nonsense is going on here? 🙃 C:\Users\chrisant>winget show clink
Failed in attempting to update the source: winget
Found Clink [chrisant996.Clink]
Version: 1.4.12.9ce7e8
Publisher: Christopher Antos
Publisher Url: https://github.com/chrisant996/
Publisher Support Url: https://github.com/chrisant996/clink/issues
...
Release Notes Url: https://github.com/chrisant996/clink/releases/tag/v1.4.12
...
Installer:
Installer Type: nullsoft
Installer Url: https://github.com/chrisant996/clink/releases/download/v1.4.12/clink.1.4.12.9ce7e8_setup.exe
Installer SHA256: 3079cbc86df1a6273a1a7f2deb8195d165d9f3717fd9100ba64b0674e233ce74
Release Date: 2023-01-20 I found some reports online about "Failed in attempting to update the source: winget". I have the latest released winget v1.4.10173. Is this an ignorable error caused by a server side cert problem as noted in microsoft/winget-cli#1656? Is my local cache of known versions stuck at somewhere around Jan 2023? But I'm still confused why |
I installed v 1.4.18 via winget and noted the ARP Entries. Then I launched clink, and ran I wiped the VM and re-installed 1.4.18, took note of the ARP entries. Then I ran I then looked at the metadata in the winget manifests and assessed how the matching logic would handle each scenario - comparing versions of different lengths and also how it interprets product codes, and described these in my original response.
That makes sense, but I'm not sure if that is actually happening
I will check
I haven’t taken a deep dive into how the zip updater works. I can understand why it may be updating the registry, but haven’t investigated yet |
Aha. Apparently on my system winget is only able update its sources when run with elevation. It would be nice if it could explain that. I don't know why it requires admin access. Now that it's been able to update its sources, So now I started the test over:
That's the problem: the .zip updater is accidentally getting run when it shouldn't be. And since the .zip updater has vestigial code to update regkeys (and in an incorrect manner), then things get weird, and since it attempted to update regkeys it can be easy to think it was working as intended, and easy to miss that it flew completely off the rails and down the embankment into the river. 😜 I'm debugging what's going on. |
clink/clink/app/scripts/update.lua Line 37 in 3563f62
UPDATE: I forgot -- it wasn't an embarrassing mistake. It was intentional, because during beta testing malware protection was getting excited too frequently for some users and blocking .exe installer from running. Always using the zip updater code was intentional to work around false positives in malware protection. 😕 So, it's indeed necessary to deal with the product code stuff. |
Ok. I've tested updates mocking everything except the github site access, and doing multiple combinations of updating via .exe installers and .zip files. To the best of my knowledge and testing, it should work correctly in v1.4.21. However, until a v1.4.21 or higher .exe installer runs, winget may still get confused and think there's an update when it's actually up to date. But that should ok, since if winget is confused it will run the latest .exe installer. Which will update to a constant product code, which should get things into agreement. I hate making changes to established updater logic. It's nerve wracking. One tiny oversight and updating can become completely broken, which then prevents deploying a fix. However, as far as I can tell, everything will be good moving forward from v1.4.21. 🤞🍀
|
Great idea! Makes perfect sense
This should make things much easier to keep straight. I'm glad that the hash didn’t need to be "ripped out" everywhere, since I know it can be useful. I'll keep an eye on the winget side, and once 1.4.21 can help test the matching and upgrade. |
Thanks very much for the confirmation, @MagicAndre1981 ! 🙂 |
Added "bug" label for tracking purposes, since there was something Clink wasn't doing quite properly from winget's perspective. Keeping "external" label as well, since it was mostly about how winget assumed things would be done by apps. |
ok, now it works as I expected this. Now it no longer matters how you update clink. Perfect 👍 |
I love the community cross collaboration! And, for what it's worth, I also tend to keep issues open at winget-pkgs with an "Area-External" label to help identify when the issue requires something "outside" that repository to change in order to resolve issues. |
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
chrisant996/clink#306 Signed-off-by: Kaleb Luedtke <trenlymc@gmail.com>
After updating with
clink update
you still see an update when yourun winget
upgrade:So maybe it is better to download the installer (not simply unzip the new files) and run the same silent mode like when doing an upgrade with winget.
Originally posted by @MagicAndre1981 in #303 (comment)
The text was updated successfully, but these errors were encountered: