-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
"Download Now" button should respect the used installation method on Linux #43671
Comments
Nice solution 👍. Opening up to PRs for now, most relevant files are likely |
Ive got the same issue, using deepin (based on debian) I just updated from 120.xxx, An alternative solution might be to check for the presence of GDebi on the system (or another package installer that consumes .deb packages), this information is probably available in the mime file type system somewhere. |
@flurbius well the solution needs to cover the following install types:
Checking for gdebi probably wouldn't be enough, ideally we would check if vscode was installed through I mentioned the 2 files in my comment above that will likely need changing for this, let me know if you have more specific questions 😃 |
The think the ideal behavior for deb and rpm would actually be to either not show the download now button at all, or query the detected apt/yum/dnf for whether there is an update and then provide a notification (which defers to software updater?) |
PackageKit could be relevant here |
@ZanderBrown we probably wouldn't want to ship some extra dependency like this when we could just query the various package manages when available? |
PackageKit is used by GNOME Software (inc Ubuntu Software) and KDE Discover and as such is present on many systems already. It acts as an abstraction to the various underlying package managers and is actually used in a few extensions already e.g. Uncrustify |
@shroudedcode @Tyriar Querying various package managers to check if a Code package was installed via one of them may let some Code instances be incorrectly attributed. It could be that more than one install of Code is on a machine, installed via different methods (e.g. via apt for day-to-day, via source for bleeding edge). Ideally, any check should be specific to a running instance. You can check if a running instance was installed from a deb with Although not automatic, a new setting(s) in Code to disable update checks, notifications and the download menu item, would be a nice enough solution for many people I think. |
|
@ZanderBrown I missed your initial comment about PackageKit. If your method works as well as it looks like it should do, then that looks like the way to go! As far as I can tell, PackageKit is going to be standard on practically any Linux distro that's likely to be running Code. |
@Tyriar looks like this issue needs attention. I'm starting out with VS Code contributions, and I'd like to take this up in case no one else is working on it. |
@kanishk98 sure, the best place to start is updateService.linux.js: I think this will involve detecting whether it's installed in apt-get/apt or dnf/yum there, and if so route to a new download url. You will need to add some keys to product.json to get this to work (downloadUrlDeb, downloadUrlRpm), when we merge the PR I'll will add these keys to the official build's product.json. |
Thanks for the help, @Tyriar. I have a couple of solutions in mind for the problem, and I'll implement them as you suggest:
I'm not sure what approach the VS community would prefer, so I figured it's better to ask before writing any code. |
@kanishk98 command-v-apt doesn't seem to be available on Ubuntu 18.10? Ideally we will do this checking without any additional dependencies. ideally we would query apt or dnf themselves (or packagekit?). Scanning |
@kanishk98 I'd still recommend packagekit |
@Tyriar sorry, didn't know Ubuntu 18.10 would be a problem with |
@kanishk98 @Tyriar I'm guessing kanishk98 means @kanishk98 Look at @ZanderBrown's comments regarding PackageKit, earlier in this thread. That seems like the best direction to head in. |
@kanishk98 I'm just having a quick play with PackageKit command line tools to see how best to check if a package is installed or not. The command, If
If
If
All three examples return exit code 0. Checking for the The VSCode package for Ubuntu is called I had a quick search for distro support of PackageKit. I didn't turn up first versions / dates for when support started, but it seems very widespread nowadays and goes back to 2008 in the case of Fedora. I'll look into that more when I get a chance later. |
Wouldn't it be better to just do nothing, in that case? No routing to a download URL, no VSCode notifications; just leave it to the OS package manager from there on. |
@monkeyhybrid I thought we'd ruled out the possibility of using Considering Code's website offers three options for Linux installation - .deb, .rpm, and a tarball, shouldn't it be simpler and more reliable to just run Let me know if I'm missing something here. |
@kanishk98 I just tested with a Ubuntu 16.04 virtual machine and you're right, no default support for PackageKit. It's an LTS release too, so could be around for a few years to come. Hmmm, that's a shame. :( So I guess that leaves the options as:-
|
I just had a peek at the Gulp build file for Linux and there are references to Snap and Flatpak packages in addition to deb and RPM. On top of that, there are multiple AUR packages made by the Arch community, and I'm sure the same applies to other distros. Checking all of this could be a real mess. So... how about this:
Bonus is that people building third-party packages can also easily disable update checks as part of their build process, with no need for distro specific tests and no risk of false positives. The same applies for macOS builds in Brew / MacPorts, or anything else for that matter. I haven't checked, but I would guess this is similar to how Firefox packages are built, for example. Everyone's a winner? |
If we could differentiate Available and repo not installed that would be best.
References to flatpak will be removed, AUR is managed by the community and we should route to the regular download url in this case. Snap is in progress and will be handled when that gets handled. For now we only need to worry about deb and rpm and fallback to the regular download url.
We already have this: |
That should be simple enough if we check stdout. When there is no package:
When the package is available but not installed:
When the package is installed:
|
Any new update on this issue? |
@Tyriar can't the tarball installation be automated for any reason? I think that a process could just:
As a side note, in my case, when I hit "Download update (1)" the URL https://code.visualstudio.com/ is opened in my browser but nothing is automatically downloaded (and in that page there is no download link for the tar.gz version, you must go to https://code.visualstudio.com/Download to find the download link). Think that the issue description is for an outdated version (I checked with 1.54.1 trying to update to latest 1.56.1) |
@rubensa if you're after automated updates you should use a package. The tarball is there for people who don't want packages and/or want to script their own installs in some special way. |
There seems to be a delay between the button appears "1" and the deb is in the repo. So often when I see the update available notification. I try a |
Issue Type
Bug
Description
How to reproduce
(1)
to appear on the settings icon.Expected behavior
VSCode starts the download of the latest version's file (when the
.tar.gz
was used to install VS Code) or instructs the user to run an update through the relevant package manager.Actual behavior
VS Code always starts the download of the latest version's
.tar.gz
file.Possible solution
VS Code could check what type of download was used to install and behave differently based on that.
Checking whether a
.deb
was used could look something like this:Another option would be to include the information about what installation method was used in the release.
VS Code Info
VS Code version: Code 1.20.0 (c63189d, 2018-02-07T17:10:15.949Z)
OS version: Linux x64 4.13.0-32-generic
System Info
The text was updated successfully, but these errors were encountered: