Skip to content

Update chocolatey package #190

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

Merged
merged 8 commits into from
Mar 2, 2019

Conversation

gep13
Copy link
Contributor

@gep13 gep13 commented Feb 23, 2019

No description provided.

- This is no longer required, as Chocolatey wraps this up internally
- And Install-VisualStudioVsixExtension rather than Install-ChocolateyVsixPackage
- This will mean that package installation will work for VS 2017, as well as older versions
@gep13 gep13 changed the title Update chocolatey package [WIP] Update chocolatey package Feb 23, 2019
@gep13
Copy link
Contributor Author

gep13 commented Feb 23, 2019

@laurentkempe I have started a PR for the suggested changes to the Chocolatey Package for GitDiffMargin.

This includes the usage of the Chocolatey Extension Package for Visual Studio:

https://chocolatey.org/packages/chocolatey-visualstudio.extension

This includes an API compatible replacement of the built-in helper method:

https://chocolatey.org/docs/helpers-install-chocolatey-vsix-package

Which also works for newer versions of Visual Studio.

In addition to these changes, I would also suggest that you include the Checksum and Checksum Type parameters to the Cmdlet. This will allow Chocolatey to verify that the vsix that is downloaded at installation time, matches what you expect it to be. You should be able to add a step into your release pipeline to update there values, once you know what they are i.e. when the build is completed.

@laurentkempe
Copy link
Owner

In addition to these changes, I would also suggest that you include the Checksum and Checksum Type parameters to the Cmdlet. This will allow Chocolatey to verify that the vsix that is downloaded at installation time, matches what you expect it to be. You should be able to add a step into your release pipeline to update there values, once you know what they are i.e. when the build is completed.

Thx @gep13 for the PR, very much appreciated!
It seems that the URL to download the vsix from the marketplace if not anymore stable, so I was asking me if it would not be better to have a the vsix in the package?

@gep13
Copy link
Contributor Author

gep13 commented Feb 26, 2019

@laurentkempe Yes, that is certainly an option, and it does result in the most stable of packages, due to the fact that everything that is needed to do the installation is contained within the package.

If you go down this route, you will need to provide a couple of extra files into your package, namely the VERIFICATION.TXT and LICENSE.TXT file. If you run the choco new command, you will get a templated chocolatey package created, and in there it will provide you more information about why these files need to be there, and also scaffold out examples with more information.

@laurentkempe
Copy link
Owner

@gep13 Ok I will try that

@gep13
Copy link
Contributor Author

gep13 commented Feb 26, 2019

@laurentkempe let me know if you have any questions.

@laurentkempe
Copy link
Owner

@gep13 Do you know one VS extension which is doing it like that? So I could have a look to it

@gep13
Copy link
Contributor Author

gep13 commented Feb 27, 2019

@laurentkempe looks like this package is doing it:

https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/sonarlint-vs2015

NOTE: That package is using the built-in cmdlet that ships with Chocolatey, and this isn't the one that you want to be using, so you will need to change that part. The remainder of the installation script should be valid though.

@laurentkempe laurentkempe force-pushed the UpdateChocolateyPackage branch from 4c38744 to de01aff Compare March 1, 2019 21:36
@laurentkempe laurentkempe force-pushed the UpdateChocolateyPackage branch from de01aff to 3644647 Compare March 1, 2019 21:44
@laurentkempe
Copy link
Owner

laurentkempe commented Mar 1, 2019

@gep13 I have the build which work and build this artifact - GitDiffMargin.3.9.2.47.nupkg.zip

When I follow the instruction to test the package I get the following error:

Installing GitDiffMargin using VSIXInstaller version 16.0.2258                                                                                                                                                                  
Running 'Start-VSChocolateyProcessAsAdmin' with exeToRun:'C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe', statements:'/admin
 /logFile:VSIXInstaller_GitDiffMargin_20190301234223.log /quiet C:\Users\laure\AppData\Local\Temp\chocolatey\GitDiffMargin\3.9.2.47\GitDiffMargin.vsix', minimized:False, noSleep:False, validExitCodes:'0 1001'                
Elevating Permissions and running ["C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe" /admin /logFile:VSIXInstaller_GitDiffMarg
in_20190301234223.log /quiet C:\Users\laure\AppData\Local\Temp\chocolatey\GitDiffMargin\3.9.2.47\GitDiffMargin.vsix]. This may take a while, depending on the statements.                                                       
Setting RunAs for elevation                                                                                                                                                                                                     
One or more errors occurred.                                                                                                                                                                                                    
Command ["C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe" /admin /logFile:VSIXInstaller_GitDiffMargin_20190301234223.log /qui
et C:\Users\laure\AppData\Local\Temp\chocolatey\GitDiffMargin\3.9.2.47\GitDiffMargin.vsix] exited with '-2146233088'.                                                                                                           
ERROR: Running ["C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe" /admin /logFile:VSIXInstaller_GitDiffMargin_20190301234223.l
og /quiet C:\Users\laure\AppData\Local\Temp\chocolatey\GitDiffMargin\3.9.2.47\GitDiffMargin.vsix] was not successful. Exit code was '-2146233088'. See log for possible error messages.                                         
 at Start-VSChocolateyProcessAsAdmin, C:\ProgramData\chocolatey\extensions\chocolatey-visualstudio\Start-VSChocolateyProcessAsAdmin.ps1: line 130                                                                               
at Install-VisualStudioVsixExtension, C:\ProgramData\chocolatey\extensions\chocolatey-visualstudio\Install-VisualStudioVsixExtension.ps1: line 107                                                                              
at <ScriptBlock>, C:\ProgramData\chocolatey\lib\GitDiffMargin\tools\chocolateyInstall.ps1: line 14                                                                                                                              
at <ScriptBlock>, C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 48                                                                                                                                         
at <ScriptBlock>, <No file>: line 1                                                                                                                                                                                             
Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\cho
colateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\GitDiffMargin\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] e
xited with '-2146233088'.                                                                                                                                                                                                       
Calling command ['"C:\Windows\System32\shutdown.exe" /a']                                                                                                                                                                       
Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'                                                                                                                                                            
Capturing package files in 'C:\ProgramData\chocolatey\lib\GitDiffMargin'                                                                                                                                                        
 Found 'C:\ProgramData\chocolatey\lib\GitDiffMargin\GitDiffMargin.nupkg'                                                                                                                                                        
  with checksum '6CE1774822A27F5007E3565DEC4D058B'                                                                                                                                                                              
 Found 'C:\ProgramData\chocolatey\lib\GitDiffMargin\GitDiffMargin.nuspec'                                                                                                                                                       
  with checksum '11D37C4EC389EB7424F4453541182D8F'                                                                                                                                                                              

Do you have any clue what could be the problem?

@gep13
Copy link
Contributor Author

gep13 commented Mar 1, 2019

@laurentkempe was VS open at the time when you tried to install the package? If so, can you try closing it, and running the install again?

@laurentkempe
Copy link
Owner

@gep13 yeah that was the issue! 🎉

image

So next step will be to have my release pipeline doing a choco publish 😸

@gep13
Copy link
Contributor Author

gep13 commented Mar 2, 2019

@laurentkempe sounds great!

@laurentkempe laurentkempe changed the title [WIP] Update chocolatey package Update chocolatey package Mar 2, 2019
@laurentkempe laurentkempe merged commit 63e568b into laurentkempe:master Mar 2, 2019
@laurentkempe
Copy link
Owner

@gep13 👍 x 💯 Thanks a lot for the support and your great extensions for Azure Devops!

@gep13 gep13 deleted the UpdateChocolateyPackage branch September 9, 2019 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants