fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
459 stars 10 forks source link

Chocolatey package #5

Closed SebRut closed 6 years ago

SebRut commented 6 years ago

I created a Chocolatey package (https://chocolatey.org/packages/git-fork) for Fork. Unfortunately it seems like you don't always publish updates with release note on your website which makes it impossible to detect these updates. Is there any way to detect the newest version number without using the Fork client?

DanPristupov commented 6 years ago

If I remember correctly @TimHacker already made some job in this area and he had different problems. Tim, it would be great if you could participate. Thank you.

TimHacker commented 6 years ago

Ah yes, I think I found @SebRut's package when searching for it back in June. I would definitely support getting it working on Chocolatey. @DanPristupov would it be possible for you to publish all the Windows version releases in some sort of public feed? Maybe just an extension of https://git-fork.com/releasenotes?

SebRut commented 6 years ago

I found https://git-fork.com/releasenoteswin but it seems like PATCH versions (https://semver.org/) aren't listed there. My client is on 1.18.1 while the release notes only mention 1.18.

TimHacker commented 6 years ago

I guess it isn't ideal, but won't Fork auto-update once you've installed 1.18 via Chocolatey?

SebRut commented 6 years ago

That is true, but chocolatey enforces checksum validation, which isn't possible when the version in the package is 1.18 but the file available on Forks website is 1.18.1 and because of that has a different checksum. A separate download link for each version would solve this problem too.

DanPristupov commented 6 years ago

There's that file which is used by auto-update: https://git-fork.com/update/win/RELEASES

SebRut commented 6 years ago

There's that file which is used by auto-update: https://git-fork.com/update/win/RELEASES

Thank you! That should be enough. Do you know what kind of hash that is?

DanPristupov commented 6 years ago

@SebRut This file is generated by Squirrel (https://github.com/Squirrel/Squirrel.Windows). I briefly checked their source, it looks like it's SHA1.

2018-07-17 at 14 54
SebRut commented 6 years ago

Thank you.

DanPristupov commented 6 years ago

So, it looks like Chocolatey can install an initial application version and then Fork will handle the updates.

SebRut commented 6 years ago

Yes, I'll update the chocolatey package today or tomorrow, everything should work after this.

TimHacker commented 6 years ago

Exciting! Thanks @SebRut!

SebRut commented 6 years ago

Up-To-Date version is online!

TimHacker commented 6 years ago

Hi @SebRut,

I've just given it a go with

choco install git-fork

and I got this error:

Downloading git-fork from 'https://git-fork.com/update/win/ForkInstaller.exe' Progress: 100% - Completed download of C:\Users\Tim Hacker\AppData\Local\Temp\chocolatey\git-fork\1.18.1\ForkInstaller.exe (40.56 MB). Download of ForkInstaller.exe (40.56 MB) completed. Error - hashes do not match. Actual value was '461DEE4244F7F394DC60824B8E5873AA2ABE2808BF63F10C77A372951FA45367D7BF97110FE1A5910C64843766239D80C6CC922375EB879A24194DAD10D89890'. ERROR: Checksum for 'C:\Users\Tim Hacker\AppData\Local\Temp\chocolatey\git-fork\1.18.1\ForkInstaller.exe' did not meet '6ffda3f17d47770869c6bc94de3e27ce906873808538c0e437283a2d6ed9ea7f' for checksum type 'sha512'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary. The install of git-fork was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\git-fork\tools\chocolateyInstall.ps1'. See log for details.

Is this the older version still on Chocolatey? Or is this a different issue?

DanPristupov commented 6 years ago

Just want to mention that I can publish some file which will contain a checksum of the actual ForkInstaller.exe. The file generation can be a part of the Fork build process.

SebRut commented 6 years ago

Is this the older version still on Chocolatey? Or is this a different issue?

I forgot to change to checksum type back to sha256, should be fixed in minutes :)

Just want to mention that I can publish some file which will contain a checksum of the actual ForkInstaller.exe.

This would be even better.

SebRut commented 6 years ago

New version is up, @TimHacker could you test it with choco install git-fork --version 1.18.1.20180718 ?

TimHacker commented 6 years ago

Yes, that works perfectly. Thanks @SebRut! 🙌

TimHacker commented 6 years ago

Hi @SebRut, I'm getting an issue with the checksum again. Both with choco install git-fork and choco install git-fork --version 1.18.1.20180718:

Error - hashes do not match. Actual value was '1287B648A5797FC15EEBD25B67007C86368751F9821458F676409511D5A34167'.
ERROR: Checksum for 'C:\Users\Tim Hacker\AppData\Local\Temp\chocolatey\git-fork\1.18.1.20180718\ForkInstaller.exe' did not meet '6ffda3f17d47770869c6bc94de3e27ce906873808538c0e437283a2d6ed9ea7f' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
The install of git-fork was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\git-fork\tools\chocolateyInstall.ps1'.
See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
SebRut commented 6 years ago

@TimHacker thank you for the head up, I made a mistake with the checksum type and pushed an updated version manually for now. Upcoming releases should (hopefully) work automatically.

TimHacker commented 6 years ago

Perfect, the new unapproved version works well. 👌

DanPristupov commented 6 years ago

FYI, I'm planning to switch to a different installer in the near future because Squirrel makes too much problems with antiviral applications. The EXE installation package will be replaced with MSI. I'll let you know the details as far as I make a proof-of-concept.

SebRut commented 6 years ago

FYI, I'm planning to switch to a different installer in the near future because Squirrel makes too much problems with antiviral applications. The EXE installation package will be replaced with MSI. I'll let you know the details as far as I make a proof-of-concept.

Sounds good!

@DanPristupov could you tell me which files contain the configuration like Display Name and E-mail because currently every upgrade using chocolatey seems to delete the configuration and leads to reentering the information mentioned above.

DanPristupov commented 6 years ago

Hm, I think Fork update should be performed on it's own. Fork uses delta updates which are tiny (about 500 KB for an update) and also shows release notes.

--

Fork asks name and email when cannot find a git instance which is being installed on first run (because Squirrel cannot handle that).

This can change when I switch to MSI, but now there are some tricky points.

Squirrel wipes out the installation directory on install, but keeps it on update.

  1. Fork keeps it's settings in %localappdata%\fork\settings.json
  2. Git instance is located in %localappdata%\fork\git
SebRut commented 6 years ago

Hm, I think Fork update should be performed on it's own. Fork uses delta updates which are tiny (about 500 KB for an update) and also shows release notes.

The problem with this is that new versions of Fork get published to chocolatey which leads to local updating seeing the installed version as outdated even when Fork updates itself via the internal updater. Many users including me just run choco update all periodically to update all packages installed via chocolatey which leads to reconfiguring Fork after every update. To prevent this I'd add an pre- and post-install-hook which backups and restores the Fork configuration.

DanPristupov commented 6 years ago

I think the best solution there is to disable the chocolatey update.

SebRut commented 6 years ago

I think the best solution there is to disable the chocolatey update.

I just stumpled upon this guideline from chocolatey regarding self updating applications and it seems like every user would have to disable the updates by himself manually but I'll see if I can add some sort of auto disable.