Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-updating system [electron-only] #1396

Merged

Conversation

rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Oct 10, 2024

This PR adds an auto-updating system to the electron version of Cockpit.

This system informs the user when new versions are available, allows the user to download and install it, ignore it for now or skip the given version.

With it, the users don't have to reach out to GitHub to check for new versions and download them anymore.

Kapture.2024-12-11.at.06.14.54.mp4

It works here by mocking the version, which means it will almost surely work once in production. To test it with the mocks, checkout this branch.

Fix #1290.

@rafaellehmkuhl rafaellehmkuhl force-pushed the add-electron-auto-updater branch 30 times, most recently from 5d05377 to 3e735a9 Compare October 11, 2024 11:44
@rafaellehmkuhl rafaellehmkuhl force-pushed the add-electron-auto-updater branch from 3ebec9e to 265a3e0 Compare November 29, 2024 22:25
@rafaellehmkuhl rafaellehmkuhl force-pushed the add-electron-auto-updater branch 6 times, most recently from 6c4c088 to 93c997d Compare December 9, 2024 21:18
@rafaellehmkuhl rafaellehmkuhl force-pushed the add-electron-auto-updater branch from 93c997d to 35c83a9 Compare December 16, 2024 16:57
@rafaellehmkuhl rafaellehmkuhl requested review from patrickelectric and ArturoManzoli and removed request for patrickelectric December 16, 2024 17:00
@rafaellehmkuhl rafaellehmkuhl marked this pull request as ready for review December 16, 2024 17:02
@ArturoManzoli
Copy link
Contributor

I'm trying to test with the mocks made, but can't get any update popup to show.

I should just checkout 'auto-update-dev-test-changes' and run the electron app?
Can it be in dev mode?

@rafaellehmkuhl
Copy link
Member Author

rafaellehmkuhl commented Dec 16, 2024

I'm trying to test with the mocks made, but can't get any update popup to show.

I should just checkout 'auto-update-dev-test-changes' and run the electron app? Can it be in dev mode?

Did you run a bun install after checking-out? There are two new packages that should be installed for it to work.

@ArturoManzoli
Copy link
Contributor

ArturoManzoli commented Dec 16, 2024

I'm trying to test with the mocks made, but can't get any update popup to show.
I should just checkout 'auto-update-dev-test-changes' and run the electron app? Can it be in dev mode?

Did you run a bun install after checking-out? There are two new packages that should be installed for it to work.

Yep, I did. Also tried from the electron AppImage executable, but it also didn't run the mocked update

@rafaellehmkuhl
Copy link
Member Author

I'm trying to test with the mocks made, but can't get any update popup to show.
I should just checkout 'auto-update-dev-test-changes' and run the electron app? Can it be in dev mode?

Did you run a bun install after checking-out? There are two new packages that should be installed for it to work.

Yep, I did. Also tried from the electron AppImage executable, but it also didn't run the mocked update

Strange. Just tested here without problems. Let me rebase the lockfile to see if that helps.

It will be used for offering auto-updates of the Electron app.
With this new implementation, the user is informed that a new version of the application is available and can choose between downloading it or not.
@rafaellehmkuhl rafaellehmkuhl force-pushed the add-electron-auto-updater branch from 35c83a9 to af65830 Compare December 16, 2024 22:14
@rafaellehmkuhl
Copy link
Member Author

@ArturoManzoli rebased. Can you try again?

If it doesn't work, try removing node-modules and the bun lockfile, and run bun install again. Bun is a pita sometimes with that.

If it still doesn't run, can you check the console (both from the terminal and browser) to see what is going on?

@ArturoManzoli
Copy link
Contributor

If it still doesn't run, can you check the console (both from the terminal and browser) to see what is going on?

It didn't help deleting the node-modules folder and the lock file.
The only thing in console during boot is:
image

@rafaellehmkuhl
Copy link
Member Author

For notice: it may be that we can't make the auto-update system work on Linux, due to restrictions on how it works, and the feature will be mac/windows-only. I confirmed already that it is working on mac and @ArturoManzoli will test to see if it's working on Windows.

There's a small chance we can make it work on Linux and this comment is maybe relevant.

@ArturoManzoli
Copy link
Contributor

For notice: it may be that we can't make the auto-update system work on Linux, due to restrictions on how it works, and the feature will be mac/windows-only. I confirmed already that it is working on mac and @ArturoManzoli will test to see if it's working on Windows.

There's a small chance we can make it work on Linux and this comment is maybe relevant.

Tested and confirmed. It works very well on Windows

@ArturoManzoli ArturoManzoli merged commit e221da8 into bluerobotics:master Dec 17, 2024
11 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the add-electron-auto-updater branch December 17, 2024 18:00
@rafaellehmkuhl rafaellehmkuhl changed the title Add electron auto updater Add auto-updating system [electron-only] Dec 18, 2024
@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-needed Change needs to be documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Desktop (electron) version needs an auto/easy-updater
3 participants