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

Install Visual Studio Extension #8

Open
dhruvchand opened this issue Apr 20, 2023 · 7 comments
Open

Install Visual Studio Extension #8

dhruvchand opened this issue Apr 20, 2023 · 7 comments
Assignees
Labels

Comments

@dhruvchand
Copy link
Collaborator

dhruvchand commented Apr 20, 2023

Is your feature request related to a problem? Please describe.
I would like to have my VS extensions installed when I receive my Dev Box

Describe the solution you'd like
As a user, I should be able to:

  1. specify a list of extensions (extension version optional) that ought to be installed on my Dev Box, using a list of packageNames from the VS marketplace
setupTasks:

 - task: install-vs-extension
    inputs:
      extension: "packageName@version"

For v1, we will NOT support path to json exports of extensions

 - task: install-vs-extension
    inputs:
      extensions: "/path/to/vsixt"

@jmatthiesen
Copy link
Member

For this initial release, we'll want to settle on Visual Studio versions that we'll support. I propose VS 2019 and VS 2022 for now and we'll see what demand is like for others.

Some things to consider:

  1. We need to find out where VS is installed on the disk. There are some resources documented on the MS Learn site, which may help here.
  2. Along with finding where VS is installed, we need to consider that different versions of VS may handle extensions differently.
  3. I like inputs used for the script in the gist referenced here - accepting a simple ID for an extension to install (easily found on the marketplace). The approach taken in the script won't be reliable enough over time, though - it relies on URL formats and HTML parsing to make it work.

I discussed this topic with a PM on the VS extensibility team and there are thoughts for simplifying extension installation in the future, but for now it sounds like a more stable solution will rely on downloading .vsix files first.

A couple approaches:
a) We require devs to download the VSIX for an extension, then reference it from their devbox.yaml (and keep commit it to source in the same repo as the devbox.yaml file).
b) (Researching) Download the VSIX, get the "VSIX ID" from the downloaded VSIX, pass the ID in to the customization task. I hear this is possible, but looking to understand more.

@jmatthiesen jmatthiesen self-assigned this Apr 25, 2023
@dhruvchand
Copy link
Collaborator Author

check if copy ID from marketplace copies an ID that VSIXinstaller accepts

@jmatthiesen
Copy link
Member

check if copy ID from marketplace copies an ID that VSIXinstaller accepts

Unfortunately, looks like the ID from that link is different from the ID that goes into the manifest for a VSIX. :( I was hopeful that would do it for us.

@dhruvchand
Copy link
Collaborator Author

  • finding package name and vs install is possible
  • running install extension using a vsix ID -- is TBD

@dhruvchand dhruvchand added the P3 label May 11, 2023
@jmatthiesen
Copy link
Member

@DavidObando & @dhruvchand - FYI the VS setup team is putting together a script we can use for this, targeting Build/Private Preview 1.

@jmatthiesen
Copy link
Member

Here is a sample script and usage details from @Preecington in the VS Setup team:
I've completed the initial demo script and placed in a private gist: https://gist.github.com/Preecington/590b9e02219d1b60a7bcc6ab6607c867

You should be able to download the file and run it like so: ./Install-VSIXExtension.ps1 -MarketplaceItemName . For example, to download and install Github Copilot, located at https://marketplace.visualstudio.com/items?itemName=GitHub.copilotvs, you would pass the item name parameter from the Marketplace URI:

./Install-VSIXExtension.ps1 -MarketplaceItemName GitHub.copilotvs

The functions inside the script are documented with script help blocks. I've tested this script through basic scenarios and the Setup Team has reviewed it, but I wouldn't consider this production code and I wouldn't ship it with any guarantees. Very much a "no warranty expressed or implied" sort of deal!

@antonellaavogadro
Copy link
Contributor

I have merged a task for this, I think we are good to close this issue. Any objections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants