Community
    • Login

    latest version download url broken

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 3 Posters 567 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mforrest
      last edited by

      I’ve been grabbing the downlink to the latest version from the XML the
      getDownloadUrl.php URL.

      It’s currently not including a “Location” like it has in the past. It’s now showing:

      <GUP>
      <NeedToBeUpdated>no</NeedToBeUpdated>
      </GUP>

      Can this be fixed? Is there another way to have a static URL always provide the latest installer?

      PeterJonesP mkupperM 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @mforrest
        last edited by

        @mforrest ,

        Can this be fixed?

        There’s nothing broken. It’s working as designed.

        The intended URL is something like https://notepad-plus-plus.org/update/getDownloadUrl.php?version=8.65&param=x64

        If getDownloadUrl.php doesn’t receive a version, it tells you it doesn’t need to upgrade.

        When Notepad++ is trying to upgrade itself, it automatically sends the version that is needed for the URL.

        If you are manually generating the URL, you must send it the version, and optionally a param. You need to map a version like “vA.B.C” to version=A.BC . As mentioned recently here, no param means it will give you the URL for the 32-bit, param=x64 means it will give you the URL for 64-bit, and param=arm64 will give you the URL for the ARM64 version.

        Is there another way to have a static URL always provide the latest installer?

        If you want to force it to always tell you it needs to be updated, then just pass it a known-“old” version. Since we’re at 8.6.7 currently, just sending version=8 to the URL, like https://notepad-plus-plus.org/update/getDownloadUrl.php?version=8&param=x64 will cause it to always say it does need to be updated and always give the location

        1 Reply Last reply Reply Quote 3
        • mkupperM
          mkupper @mforrest
          last edited by

          @mforrest and @PeterJones - I’m wondering if there has been a change to getDownloadUrl.php’s behavior. https://github.com/gup4win/wingup gets updates but I don’t think the getDownloadUrll.php that is there is the one that is used at https://notepad-plus-plus.org/update/getDownloadUrl.php

          PeterJonesP 1 Reply Last reply Reply Quote 1
          • PeterJonesP
            PeterJones @mkupper
            last edited by

            @mkupper said in latest version download url broken:

            I’m wondering if there has been a change to getDownloadUrl.php’s behavior. https://github.com/gup4win/wingup gets updates but I don’t think the getDownloadUrll.php that is there is the one that is used at https://notepad-plus-plus.org/update/getDownloadUrl.php

            First, in case you didn’t know, the “gup4win” repo is the “generic” version of wingup; Don has a slightly customized version that he uses for Notepad++ specificially here: https://github.com/notepad-plus-plus/wingup

            The getDownloadUrl.php in both those repos – whether in the generic gup4win repo or the customized repo – have had the same logic regarding requiring the version= URL parameter for 15 years; the read-from-version and compare-to-latest logic hasn’t changed since Don first uploaded it to GitHub.

            So while the version that he uploads to the website may have been customized at some point to essentially “compare to 0” if the param was missing, maybe he had that in the installed version, but forgot and put it back to the “default” that matches the npp-customized repo. But the repo histories both indicate the current behavior is intended. (I can see how it would be nice to have that if no arguments are given, but it’s easy enough to pass a dummy version argument.)

            1 Reply Last reply Reply Quote 2
            • M
              mforrest
              last edited by

              @PeterJones Thanks for the sample URL with parameters. That works great. I’m all set now.

              FYI at some point in time, the behaviour did change as I’ve been successfully using this URL with no parameters for quite some time.

              mkupperM 1 Reply Last reply Reply Quote 0
              • mkupperM
                mkupper @mforrest
                last edited by

                @mforrest said in latest version download url broken:

                FYI at some point in time, the behaviour did change as I’ve been successfully using this URL with no parameters for quite some time.

                @mforrest - do you have any logs or other notes that would help pin down the vague “quite some time” to calendar dates plus details such as exactly what you did at those times and what the response was?

                The puzzle is that the public record is that the version parameter has been both required and formatted in a specific way for many years. For example, Guide: How to correctly check for available Notepad++ updates using your web browser is from March 2019.

                There was a more recent change introduced with Notepad++ v8.5.7 in September 2023 where the format of Notepad++ version number changed from 8.56 for the previous version to 8.5.7. That broke things for those people who had been extracting the version number from Notepad++.exe and then just passing it on to getDownloadUrl.php to see if a new version was available. <NeedToBeUpdated> is always “yes” is an example of someone’s code that was broken by 8.5.7.

                I’m wondering if we should get @donho involved. Did someone else change the getDownloadUrl.php that lives at https://notepad-plus-plus.org/update/getDownloadUrl.php and you happened to notice a change in behavior?

                At one point within the last year or two donho said that Notepad++'s getDownloadUrl.php was an internal thing. He had not planned on it being used by others. Unfortunately, I can’t find that comment and don’t know if it was on https://community.notepad-plus-plus.org or a conversation on https://github.com/notepad-plus-plus.

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @mkupper
                  last edited by PeterJones

                  @mkupper said in latest version download url broken:

                  At one point within the last year or two donho said that Notepad++'s getDownloadUrl.php was an internal thing. He had not planned on it being used by others. Unfortunately, I can’t find that commen

                  here (in the <NeedToBeUpdated> topic already linked), he said,

                  https://notepad-plus-plus.org/update/getDownloadUrl.php is internal URL for Notepad++ packages doing self auto-updating, but it not supposed for outside usage (from any individual or IT people of enterprise doing it manually). Therefore no support for the internal URL normally.

                  However, I have no way so far to hide the URL from outside.
                  …
                  Note that getDownloadUrl.php could change its way to manage the auto-update in the future. Since it’s an internal used URL, there’s no warranty to keep its retro-compatibility.

                  So the conclusion that I draw: @mforrest and others may use it as-is if they want to take the risk (because he cannot stop them), but they need to understand that the rules used behind-the-scenes are allowed to change at any time, without notice.

                  —
                  update: further, this post confirms that the behavior of missing version= changed at the same time as Don’s 2023-Sep-21 update to allow either version=X.Y.Z or version=X.YZ – since we know there was a change there, but the versions in the npp-specific wingup repo and in the gup4win repo haven’t changed in 8 years, we also can conclude that the one actually used by Notepad++ is custom, even compared to the notepad-plus-plus/wingup repo version.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors