Prevent .deb packages from being opened with archive manager. #7502

Merged
Ruk33 merged 11 commits from 7495-deb-update-fails-to-launch-on-ubuntu into master 2022-07-07 22:48:43 +02:00
Ruk33 commented 2022-03-03 02:12:07 +01:00 (Migrated from github.com)

Fixes

Issue Number: https://github.com/lbryio/lbry-desktop/issues/7495

What is the current behavior?

With Ubuntu >= 20 .deb packages are opened with archive explorer.

What is the new behavior?

.deb packages are properly installed and the app relaunches when the installation finishes.

image

image

image

^ if there is an error (ie, incorrect password or permission wasn't granted), we let the user know.

image

When the installation finishes, the app will relaunch automatically.

Other information

How to test

From /lbry-desktop/ui/redux/actions/app.js, replace lines 218:224 with:

      // if (
      //   upgradeAvailable &&
      //   !selectModal(state) &&
      //   (!selectIsUpgradeSkipped(state) || remoteVersion !== selectRemoteVersion(state))
      // ) {
      //   dispatch(doOpenModal(MODALS.UPGRADE));
      // }
      dispatch(doOpenModal(MODALS.UPGRADE));

And update line 213 with:

      dispatch({
        type: ACTIONS.CHECK_UPGRADE_SUCCESS,
        data: {
          upgradeAvailable: true, // <- here
          remoteVersion,
        },
      });
  • Run yarn build
  • Install deb package from /lbry-desktop/dist/electron
  • Open up the recent installed version with lbry

PR Checklist

Toggle...

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I added a line describing my change to CHANGELOG.md
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below
## Fixes Issue Number: https://github.com/lbryio/lbry-desktop/issues/7495 <!-- Tip: - Add keywords to directly close the Issue when the PR is merged. - Skip the keyword if the Issue contains multiple items. - https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword --> ## What is the current behavior? With Ubuntu >= 20 .deb packages are opened with archive explorer. ## What is the new behavior? `.deb` packages are properly installed and the app relaunches when the installation finishes. ![image](https://user-images.githubusercontent.com/1719111/156479732-21f5f84c-8cf0-455a-a8c9-43250951594c.png) ![image](https://user-images.githubusercontent.com/1719111/156479771-da732a9e-659c-4bf8-a1eb-656bf5e61093.png) ![image](https://user-images.githubusercontent.com/1719111/156479820-49c37c6d-2227-48d2-806d-24ce6e047b30.png) ^ if there is an error (ie, incorrect password or permission wasn't granted), we let the user know. ![image](https://user-images.githubusercontent.com/1719111/156479862-46c2151b-cb8a-4228-8426-ef03cca9ad7b.png) When the installation finishes, the app will relaunch automatically. ## Other information ### How to test From `/lbry-desktop/ui/redux/actions/app.js`, replace lines 218:224 with: ```js // if ( // upgradeAvailable && // !selectModal(state) && // (!selectIsUpgradeSkipped(state) || remoteVersion !== selectRemoteVersion(state)) // ) { // dispatch(doOpenModal(MODALS.UPGRADE)); // } dispatch(doOpenModal(MODALS.UPGRADE)); ``` And update line 213 with: ```js dispatch({ type: ACTIONS.CHECK_UPGRADE_SUCCESS, data: { upgradeAvailable: true, // <- here remoteVersion, }, }); ``` - Run `yarn build` - Install `deb` package from `/lbry-desktop/dist/electron` - Open up the recent installed version with `lbry` <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. --> ## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> <details><summary>Toggle...</summary> What kind of change does this PR introduce? - [x] Bugfix - [x] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [ ] Other - Please describe: Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [ ] I added a line describing my change to CHANGELOG.md - [x] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below </details>
jessopb commented 2022-03-04 00:24:35 +01:00 (Migrated from github.com)

Good progress. I can still get into double downloads. Flow feels good otherwise.

Good progress. I can still get into double downloads. Flow feels good otherwise.
Ruk33 commented 2022-03-04 16:02:58 +01:00 (Migrated from github.com)

Thank you @jessopb for the review. I have sent a fix for it.

Thank you @jessopb for the review. I have sent a fix for it.
jessopb commented 2022-03-07 14:46:12 +01:00 (Migrated from github.com)

I tested this on linux by yarn build this branch after changing the version in package.json to 0.52.4. Then installing that build from the .deb.
Unfortunately, it's throwing an error looking for app-update.yml when lbry is launched from console and never shows the update available notifications. It does provide, in help page, the suggestion to download the lastest version which navigates the user to the download website.
To confirm it was this branch, I built master locally in the same way, with version set to 0.52.4 as well, and the update notifications and nags were present in that case. And there were no console complaints about app-update.yml
It doesn't look to me like something in this pr could change that, but it does ???

I tested this on linux by `yarn build` this branch after changing the version in package.json to 0.52.4. Then installing that build from the .deb. Unfortunately, it's throwing an error looking for `app-update.yml` when `lbry` is launched from console and never shows the update available notifications. It does provide, in help page, the suggestion to download the lastest version which navigates the user to the download website. To confirm it was this branch, I built master locally in the same way, with version set to 0.52.4 as well, and the update notifications and nags were present in that case. And there were no console complaints about `app-update.yml` It doesn't look to me like something in this pr could change that, but it does ???
Ruk33 commented 2022-03-14 14:43:26 +01:00 (Migrated from github.com)

Hello @jessopb. I'm pretty sure the error you are facing isn't coming from this PR but for this: https://github.com/lbryio/lbry-desktop/pull/7492/files#diff-9e864f33e9f6d8e9a52d5df4de9861f47a3a45222f1f8fb620acd9c37193bb12R198
Notice how we previously, for .deb installations, we check for updates using Native.getAppVersionInfo().then(success, fail); but after the change, it always uses the ipcRenderer.send('check-for-updates', ...) call.

Hello @jessopb. I'm pretty sure the error you are facing isn't coming from this PR but for this: https://github.com/lbryio/lbry-desktop/pull/7492/files#diff-9e864f33e9f6d8e9a52d5df4de9861f47a3a45222f1f8fb620acd9c37193bb12R198 Notice how we previously, for `.deb` installations, we check for updates using `Native.getAppVersionInfo().then(success, fail);` but after the change, it always uses the `ipcRenderer.send('check-for-updates', ...)` call.
Ruk33 commented 2022-03-14 15:03:23 +01:00 (Migrated from github.com)

To prevent having this error, you can create the following file app-update.yml in /opt/LBRY/resources

owner: lbryio
repo: lbry-desktop
provider: github

And re-open the app. With that, the error no longer shows up:

image

To prevent having this error, you can create the following file `app-update.yml` in `/opt/LBRY/resources` ``` owner: lbryio repo: lbry-desktop provider: github ``` And re-open the app. With that, the error no longer shows up: ![image](https://user-images.githubusercontent.com/1719111/158188171-625f1600-1200-4544-a6d7-7678a3415b89.png)
Ruk33 commented 2022-03-21 14:55:56 +01:00 (Migrated from github.com)

Hello, is there anything I need to update in this pr? Please let me know, happy to update if required. Thanks.

Hello, is there anything I need to update in this pr? Please let me know, happy to update if required. Thanks.
jessopb commented 2022-03-23 20:34:32 +01:00 (Migrated from github.com)

This may be the right track, but I'm not sure how this is a solution fit for production. The problem is not only the console error, but also the lack of update notification in the app, which did not happen before, if I recall correctly.
https://github.com/lbryio/lbry-desktop/pull/7502#issuecomment-1066832556

Perhaps the solution is this sort of file copy? https://www.electron.build/configuration/contents#extraresources

This may be the right track, but I'm not sure how this is a solution fit for production. The problem is not only the console error, but also the lack of update notification in the app, which did not happen before, if I recall correctly. https://github.com/lbryio/lbry-desktop/pull/7502#issuecomment-1066832556 Perhaps the solution is this sort of file copy? https://www.electron.build/configuration/contents#extraresources
Ruk33 commented 2022-06-22 04:56:28 +02:00 (Migrated from github.com)

@jessopb I have sent an update for the missing app-update.yml. After reading, it seems like just adding it as a additional resource is the best option. Will keep testing tomorrow to make sure everything is ok.

@jessopb I have sent an update for the missing `app-update.yml`. After reading, it seems like just adding it as a additional resource is the best option. Will keep testing tomorrow to make sure everything is ok.
jessopb commented 2022-06-22 23:21:14 +02:00 (Migrated from github.com)

I'm seeing windows misreporting the title of the prerelease as a release, though it upgrades properly.
I'm seeing deb misreporting the release instead of prerelease in the "begin upgrade" modal sudo... [release].deb
Also, closing the upgrade modal (reexposing the nag) and opening it again reinitiates the download.

I'm seeing windows misreporting the title of the prerelease as a release, though it upgrades properly. I'm seeing deb misreporting the release instead of prerelease in the "begin upgrade" modal `sudo... [release].deb` Also, closing the upgrade modal (reexposing the nag) and opening it again reinitiates the download.
jessopb commented 2022-07-07 22:38:27 +02:00 (Migrated from github.com)

I'm going to merge this anyways, but:

Couple small bugs for .deb -
Flood of these while downloading

Function provided here: ui.js:2:3954536

Attempting to call a function in a renderer window that has been closed or released.

And, after cancelling download and restarting, progress bar is back at 0 and titled "Downloading Update" (but not making progress). The modal is otherwise ready to upgrade.

Otherwise, the sudo-prompt worked very well.

I'm going to merge this anyways, but: Couple small bugs for .deb - Flood of these while downloading ``` Function provided here: ui.js:2:3954536 Attempting to call a function in a renderer window that has been closed or released. ``` And, after cancelling download and restarting, progress bar is back at 0 and titled "Downloading Update" (but not making progress). The modal is otherwise ready to upgrade. Otherwise, the sudo-prompt worked very well.
jessopb (Migrated from github.com) reviewed 2022-07-07 22:42:05 +02:00
jessopb (Migrated from github.com) commented 2022-07-07 22:42:05 +02:00

There's also something strange that happened - I pushed a tag with 'alpha' in it which ended up on top of the list, but there were no builds associated with it (also, the tag erroneously was nested in "", so updates were failing. Probably some library code that just gets the last tag with a prerelease keyword in it. After I deleted the bad tag, it was fine.

There's also something strange that happened - I pushed a tag with 'alpha' in it which ended up on top of the list, but there were no builds associated with it (also, the tag erroneously was nested in `""`, so updates were failing. Probably some library code that just gets the last tag with a prerelease keyword in it. After I deleted the bad tag, it was fine.
jessopb (Migrated from github.com) reviewed 2022-07-07 22:45:54 +02:00
@ -67,6 +67,7 @@
"remove-markdown": "^0.3.0",
"rss": "^1.2.2",
"source-map-explorer": "^2.5.2",
"sudo-prompt": "^9.2.1",
jessopb (Migrated from github.com) commented 2022-07-07 22:45:54 +02:00

This repository is archived on github. Something to keep an eye on, or fork for our selves.

This repository is archived on github. Something to keep an eye on, or fork for our selves.
jessopb (Migrated from github.com) reviewed 2022-07-07 22:47:30 +02:00
@ -15,1 +20,4 @@
// LBRY_0.53.5-alpha.test7495b.deb
const fileName = 'LBRY_' + (releaseVersion || '').replace('v', '') + '.deb';
return `https://github.com/lbryio/lbry-desktop/releases/download/${releaseVersion}/${fileName}`;
case 'win32':
jessopb (Migrated from github.com) commented 2022-07-07 22:47:30 +02:00

This could maybe use some error catching/validation. It's fine though.

This could maybe use some error catching/validation. It's fine though.
jessopb commented 2022-07-07 22:49:36 +02:00 (Migrated from github.com)

frodo after the thing is done

*frodo after the thing is done*
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#7502
No description provided.