Jump to content
Ketarin forum

Alla of a sudden Ketarin refuses to download newer version of Mountain Duck


WrongCode
 Share

Recommended Posts

Hello, first time I write on this forum.

I have the following application definition to deal with Mountain Duck. All of a sudden, Ketarin started refused to download a new version released in the past days because it states the cached version was already at the value it fetched with the definition's regex. That was with Ketarin 1.8.11.

I decided to switch Ketarin 1.9 beta, I've exported the definition (the one I am attaching) and I've delete the application from Ketarin. I exited and restarted Ketarin, re-imported the application definition, and tried to download the application, to no avail. The log states:

11/6/2023 21:27:24: Update started with 1 application(s)
11/6/2023 21:27:24: Mountain Duck: Replacing {version} in 'href=(https://dist.mountainduck.io/Mountain%20Duck%20Installer-{version}.exe)' with '4.14.1.21330'
11/6/2023 21:27:24: Mountain Duck: Checking if update is required...
11/6/2023 21:27:25: Mountain Duck: Replacing {version} in '{version}' with '4.14.1.21330'
11/6/2023 21:27:25: Mountain Duck: No previous value for {version} available, ignoring this variable as indicator for changes
11/6/2023 21:27:25: Update finished

I am out of ideas.

Thanks for any hint you can give me.

Mountain Duck.xml

Link to comment
Share on other sites

Mmm... after a further closer look at the application's web page source, it seems that the site's maintainer has messed the version strings (he used 4.14.0.21323 for the download link, and 4.14.1.21330 for the description). The {url} regex will never succeed as it is right now. Changing the {url} regex to textual content as

https://dist.mountainduck.io/Mountain%20Duck%20Installer-{version}.exe

works as temporary hack.

Nevertheless, in my opinion Ketarin when trying to update the application should alert that {url} didn't resolve to a match, instead of indicating the operation as a success

1741601490_Updatesuccess(nottrue).png.0443b4b3300f275d4ac33281437332b4.png

After enforcing the URL, it finally downloads the file:

122439251_Updatesuccess.png.ceda8c20617f5ed4ba76f27142c4db27.png

Thanks again.

Link to comment
Share on other sites

Glad you got it sorted so quickly, @WrongCode

However, I would recommend you change from the home page to the changelog to parse for version and download URLs. In my experience it's usually more reliable and consistent since the devs may not have the home page hooked into whatever release process they use so one or more values may fail to be updated as part of their manual process.

The reason you saw it failing to download was because the last version was the same file that downloaded last time -- 4.14.0.21323 -- so even though the version number changed on the homepage the binary link did not. The pattern you used for your url variable (which you used for the download URL) failed because that text didn't actually appear on the page so it couldn't parse for it, so it failed to update. You can use the ifemptythenerror function to perform validation on your variables to troubleshoot situations like this one. You can also get around that problem (here) by switching from parsing for the URL (which you clearly know is going to match that pattern anyway) to just fabricating the URL yourself as a Textual variable as so:

https://dist.mountainduck.io/Mountain%20Duck%20Installer-{version:ifemptythenerror}.exe

Change the variable type from "Content from URL (regular expression)" to "Textual content" and use that pattern and it will solve both of your big issues here.

Even so, it's possible they might change the download URL format/pattern at any time, so be careful if you do. Ketarin natively monitors eTags and dates as well so won't re-download the same binary unless you use the "force" option or the server doesn't actually report these values (rare). Later, when they discover their error and update the URL on the homepage then it doesn't solve the Ketarin side of the problem since you're using version as the "variable as indicator for changes" and your app has already detected the new version number (even if it didn't download because the url variable was defective!) so it won't download unless you resolve the underlying URL parsing problem. If you install the one that you did download you'll find that it is, in fact, the older installation package from a couple weeks ago.

The changelog page also adds a few other things you might be interested in, including the hash and other related packages. Finally, I also recommend you parse for the actual download URL and not rely on injecting the version number in the URL of the pattern they've used prior to get the file. Way too often sites will randomly include additional values (like cache busters or language flags) or change portions of the path that they did not do before (download vs dist). To help detect these situations I use a pre-download command that checks for an empty version number, and a post-download command that writes out all errors and relevant update data from each update to a log file and push it all to a web-accessible database. This allows me to monitor all of my Ketarin activity without having to rely exclusively on the Ketarin interface.

Link to comment
Share on other sites

@shawn thank you so much for the extensive answer. Indeed I normally try to not fabricate URL following a fixed pattern I discovered "visually" in the web page, but I am also still too naive in using Ketarin and I need to learn most of the hints you've thrown in your answer, especially the pre/post download tricks. Any pointer to examples on how to use them in a given use case would help.

Link to comment
Share on other sites

  • 2 weeks later...

Hi, @WrongCode ! 

There are actually a lot of tips available here on the forum. Whenever I find a novel solution to a problem I try to post about it there. Ultimately you'll want to figure out what details you actually want to keep and how aggressive to be with that data collection. It's insanely easy to get just the download and not think about everything else, but I always want to capture the changelog and any other relevant details as well (bits, OS, vendor, website and so on). Guidance for creating and using custom columns, changelogs, PowerShell variable access, and lots more at the Tips section.

The Templates section also has some demonstrations of how to do common tasks, including the use of Templates, which are pretty awesome if you download a lot of things from the same sites (like GitHub or Source Forge or NirSoft): creating a template allows you to do the major work only once, then plug in a few values when you load another app from the template. 

Finally, get Kuppet. Kuppet is a Ketarin accessory that allows you to bypass a lot of the newer HTML5 JavaScript-rendered page problems by rendering the page for you first and allowing you to capture the content from that instead of the unusable JavaScript calls alone. I'm using Kuppet in about 20-25% of my apps now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.