knoxfighter / GW2-ArcDPS-Boon-Table

MIT License
83 stars 9 forks source link

Consistent release artifacts #18

Closed solacelost closed 3 years ago

solacelost commented 3 years ago

Most of your releases have included an artifact with extension .sha containing a sha256 sum, like 2.2.0 and 2.2.1. I've been using these to check for updates at launch of my copy of Guild Wars 2 via the helper script I launch it with.

The latest release, 2.3.0 doesn't contain the checksum so I'm unable to have it automatically update at launch. Is there any way you could either use a CI system to publish builds with consistent artifacts, or otherwise maintain consistency in uploading these checksums with releases?

I appreciate what you've done here, regardless :)

solacelost commented 3 years ago

I see that you've actually included the change in your release notes, now upon going to actually read them (oops).

I don't think this is a good change, as it's easier for external tooling to download a checksum to validate than it is to download the entire .dll and parse out metadata embedded into the binary.

knoxfighter commented 3 years ago

you don't have to download the dll to check anything. Just use the github API to check the VS_VERSION_INFO. I use that variant to check for newer updates. Just call https://api.github.com/repos/knoxfighter/GW2-ArcDPS-Boon-Table/releases/latest. Read the json field tag_name, rmeove the v and compare it. https://github.com/knoxfighter/arcdps-extension/blob/6ed7d416b889993a8db667c28052f478ac32fac9/UpdateCheckerBase.cpp#L89

I find it the better way, a lot of people where confused about the sha file added to releases :(

solacelost commented 3 years ago

So, supposing your extension is not running and I don't have access to VS_VERSION_INFO in memory, how would I externally determine that I need to download an update? My old method was that I would checksum the binary I had, download the checksum of the latest release, and then if the latest release checksum was different I would download the latest binary before validating the checksum again.

Under the new system, your proposed method only works for your own extension while it's running. I do not want the extension to manage its own updates, I want to be able to manage them externally.

I know how to use the API, and that's not the issue here. The problem I have now is determining what the version of an arbitrary blob that I have already downloaded is. Checksums were a way of doing that pretty effectively.

knoxfighter commented 3 years ago

What do you want to use, that you are not able to retreive the VS_VERSION_INFO? The VS_VERSION_INFO is something linked into the executable and available just from reading the file.

The link to my extensions is an example, how to do it in C/C++ with the windows API.

Reading in powershell:

(Get-Item d3d9_arcdps_table.dll).VersionInfo.FileVersion

Reading it in C without Windows API: https://stackoverflow.com/questions/12396665/c-library-to-read-exe-version-from-linux

Information how it is saved: https://devblogs.microsoft.com/oldnewthing/20061220-15/?p=28653

solacelost commented 3 years ago

I'm in Linux and don't intend on installing Powershell or .NET to support reading headers for PE files. I suppose I'll have to bring in a Python library to parse them. This is significantly less convenient than simply being able to check the checksum, and less reliable without being able to verify the download to boot.

I wish you'd simply reconsider but I understand you're under no obligation to do so.