end2endzone / ShellAnything

ShellAnything is a C++ open-source software which allow one to easily customize and add new options to *Windows Explorer* context menu. Define specific actions when a user right-click on a file or a directory.
MIT License
180 stars 27 forks source link

Make a 'check for update' executable that propose to download the latest version if available. #65

Open end2endzone opened 4 years ago

end2endzone commented 4 years ago

In the ShellAnything menu, a new menu entry could be created to allow the user to run an executable that checks for new version of ShellAnything.

The latest version can be found here: https://github.com/end2endzone/ShellAnything/releases/latest

If a new version is found, it could open its download url in the users default browser.

GasDauMin commented 3 years ago

How about idea.

We have to create simple page where we trying parsing current version from git and comparing with version of aplication? For transfering current application version we can use GET HTTP methodology. And correct me if I'm wrong, we can host parser in github directly.

image

Example: https://www.irfanview.com/checkversion.php?ver=4.56

end2endzone commented 3 years ago

Hi. Thank you for providing feedback and new ideas to this issue.

I do not think that using GitHub Pages would be necessary as GitHub already provides an API to get the latest version in an easily parse-friendly format:

If you browse to https://api.github.com/repos/end2endzone/ShellAnything/releases/latest you get a nice JSON file which provides all the same information available as the html version.

As of today, the following JSON file is downloaded: (note that I have omitted many tags for clarity)

{
  "url": "https://api.github.com/repos/end2endzone/ShellAnything/releases/33953477",
  "assets_url": "https://api.github.com/repos/end2endzone/ShellAnything/releases/33953477/assets",
  "tag_name": "0.5.1",
  "target_commitish": "master",
  "name": "0.5.1",
  "draft": false,
  "prerelease": false,
  "created_at": "2020-11-14T15:47:46Z",
  "published_at": "2020-11-14T15:50:07Z",
  "assets": [
    {
      "url": "https://api.github.com/repos/end2endzone/ShellAnything/releases/assets/28314977",
      "id": 28314977,
      "node_id": "MDEyOlJlbGVhc2VBc3NldDI4MzE0OTc3",
      "name": "ShellAnything-0.5.1-win64.exe",
      "label": null,
      "content_type": "application/x-msdownload",
      "state": "uploaded",
      "size": 1376274,
      "download_count": 17,
      "created_at": "2020-11-14T16:08:15Z",
      "updated_at": "2020-11-14T16:08:18Z",
      "browser_download_url": "https://github.com/end2endzone/ShellAnything/releases/download/0.5.1/ShellAnything-0.5.1-win64.exe"
    },
    {
      "url": "https://api.github.com/repos/end2endzone/ShellAnything/releases/assets/28314978",
      "id": 28314978,
      "node_id": "MDEyOlJlbGVhc2VBc3NldDI4MzE0OTc4",
      "name": "ShellAnything-0.5.1-win64.msi",
      "label": null,
      "content_type": "application/octet-stream",
      "state": "uploaded",
      "size": 1880064,
      "download_count": 13,
      "created_at": "2020-11-14T16:08:18Z",
      "updated_at": "2020-11-14T16:08:20Z",
      "browser_download_url": "https://github.com/end2endzone/ShellAnything/releases/download/0.5.1/ShellAnything-0.5.1-win64.msi"
    },
    {
      "url": "https://api.github.com/repos/end2endzone/ShellAnything/releases/assets/28314974",
      "id": 28314974,
      "node_id": "MDEyOlJlbGVhc2VBc3NldDI4MzE0OTc0",
      "name": "ShellAnything-0.5.1-win64.zip",
      "label": null,
      "content_type": "application/zip",
      "state": "uploaded",
      "size": 1646531,
      "download_count": 13,
      "created_at": "2020-11-14T16:08:13Z",
      "updated_at": "2020-11-14T16:08:15Z",
      "browser_download_url": "https://github.com/end2endzone/ShellAnything/releases/download/0.5.1/ShellAnything-0.5.1-win64.zip"
    }
  ],
  "tarball_url": "https://api.github.com/repos/end2endzone/ShellAnything/tarball/0.5.1",
  "zipball_url": "https://api.github.com/repos/end2endzone/ShellAnything/zipball/0.5.1"
}

From the JSON file, we can get the latest version from tag_name tags.

I did not planned on allowing ShellAnything to actually download the installers because they can change over time but it is still a possibility. If required, then each assets' browser_download_url tag can be used to get a downloadable url.