-
Notifications
You must be signed in to change notification settings - Fork 904
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-ChocolateyVsixPackage.ps1 Doesnt work with 2017 packages #1201
Comments
The install dir for Visual Studio 2017 is no longer discoverable from the registry and instead you need to make a few COM calls to the setup engine to query it for installs. Thus the logic to find a valid VSIXInstaller.exe to use for the install in Install-ChocolateyVsixPackage.ps1 will need to be changed for 2017 installs. |
@bbowman you can use the vswhere.exe to find the installation path. |
vswhere is actually available as a Chocolatey Package: https://chocolatey.org/packages/vswhere |
@ferventcoder @gep13 Thanks guys! I coded up a small workaround for our package at microsoft/WinObjC#2233 ... I still think this is a good candidate to get into 0.10.5 I also saw that there are a few more error states for blocked process that makes an unattended / silent install challenging. I'd love to see some ideas on how to handle that. |
#725? |
Finally found this issue after trying to spin up a new Vagrant box with
So installing and running vswhere shows me
The registry has these entries
The VsixInstaller.exe can be found in |
@ferventcoder #725 is different. The scenario in this case is that the user has visual studio running when trying to install a 2017 VSIX. When not running the installer in quiet mode, the GUI shows that the running instance of VS is blocking the install and the installer waits until the user closes this otherwise unrelated process. The unattended installer just hangs for ~5 minutes and then returns 2004? (I'm on mobile so I forget the exact error code and can't easily look it up) to indicate the install is blocked. In my package I error out here and show a message about closing instances of VS and to try again. Ideally I'd like to be able to still succeed (with the users help) in this case. Maybe the chocolatey script needs to list known VS processes that are running on the machine? Perhaps @gep13 or others familiar with vswhere know of a way to query for running instances or something to be more useful than a 5 minute timeout. Thoughts? |
@bbowman is this new? I always thought I could install VSIXs with Visual Studio running before. If this is new, wouldn't you agree that this is kind of suboptimal and it (VSIX installer) should allow the install to move forward but just not load it into the currently running Visual Studio? |
Taking Chocolatey out of the equation for a moment and just talking about silent installation. What options are available here? |
@ferventcoder Yes this is new. Visual Studio changed their extension model for 2017 (@heaths can probably shed some light here or knows who can?). I would agree that the silent installation option doesn't seem as robust in the model. I also know that VS2017 update 1 is coming soon so maybe there are improvements we can expect there? In terms of options for silent installation in general:
Seems like we have a few not great options. Ideally we can get some input from vs folks to make a better choice? |
Another option here:
In a pinch, option 3 could be used. However even that option still needs a timeout as otherwise it is not a robust enterprise type of deployment without some predictability of silent deployment (blocking on a GUI thread forever is a non-starter). Option 2 is probably the next option - it would need to exit with a different code so it's known why it failed. Here's the best option - support all three of your options by adding additional switches to the VSIX installer to allow for these options to be set by the user performing the installs. Then set a sensible default, which might be 2 or 3. |
Where does the VS team congregate these days? Where can we file issues? |
This is probably as good a place to start as any... https://gitter.im/Microsoft/extendvs Lots of VS Development Team people's in there. |
Also https://github.com/Microsoft/vsixbootstrapper seems like it might be useful for this discussion. |
A slight semantic change from Install-ChocolateyVsixPackage is that the VisualStudioVersion parameter is declared (for API compatibility), but ignored. It never worked properly as advertised in the original helper (it influenced the choice of the vsixinstaller.exe version to use, but did not explicitly restrict the installation to specific VS versions). Also, I believe that choice should be left at the discretion of the user (possible now via --package-parameters), not hardcoded in the the package by the maintainer. The extension is currently in prerelease status (version 1.6.0-rc7), pending some more testing. It can be evaluated using the latest prerelease of the
If nothing bad comes up, I'll release the packages as official versions in a couple of days. |
Both packages are now available as official versions: chocolatey-visualstudio.extension, stylecop-vsix. |
I am unable to install any extensions from the VS Gallery. It looks like there is still an issue. Can you try the following? Install-VisualStudioVsixExtension -PackageName "WixToolsetExtension" -VsixUrl https://marketplace.visualstudio.com/_apis/public/gallery/publishers/RobMensching/vsextensions/WixToolsetVisualStudio2017Extension/0.9.21.62588/vspackage
|
Scratch that. I'm guessing you are running Try building an actual package for that vsix and installing it with choco. |
I think I tried it from a boxstarter package as that's where I want to use
it. Is that supported?
…On Tue, 15 May 2018, 21:19 Jakub Bereżański, ***@***.***> wrote:
@theperm <https://github.com/theperm> can you create an issue here?
Scratch that. I'm guessing you are running
Install-VisualStudioVsixExtension directly from a PowerShell prompt
(after manually importing the chocolatey-visualstudio.psm1 and
chocolateyInstaller.psm1 modules). The error you are running into is
expected in this case, because the helper functions expect certain
environment variables to be set (choco.exe does it before invoking the
PowerShell scripts).
Try building an actual package for that vsix and installing it with choco.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1201 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAyHqWfw47igUHCaZQQtv3xIZkMWC-m9ks5tyzhIgaJpZM4Mb_p->
.
|
As I have no experience with Boxstarter, I don't know how Boxstarter packages and their execution environment differ from Chocolatey packages. I suggest you put Boxstarter aside for the moment, build and test your package in plain Chocolatey, and, once you confirm it works, try to install it with Boxstarter (and seek assistance from Boxstarter authors if something fails at that point). |
Please follow https://blogs.msdn.microsoft.com/heaths/2016/09/15/changes-to-visual-studio-15-setup/ to find VS installs now.
The text was updated successfully, but these errors were encountered: