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

Chocolatey Licensed Extension is not loaded into PowerShell process when using v0.11.0 #2340

Closed
vexx32 opened this issue Sep 2, 2021 · 6 comments · Fixed by #2341
Closed

Comments

@vexx32
Copy link
Member

vexx32 commented Sep 2, 2021

What You Are Seeing?

When attempting to use version v0.11.0 of Chocolatey alongside the Chocolatey Licensed Extension, the chocolatey.licensed.dll is not loaded as when Chocolatey PowerShell host is instantiated.

This is related to this change where we moved away from loading assemblies which are placed into the extensions folder. However, by doing this, we prevent the loading of the Licensed PowerShell cmdlets (for example Stop-ChocolateyWindowsServiceCmdlet which is used within the chocolatey-agent package).

It's likely this will also break Central Management installations, and anything else that relies on cmdlets that are only present in the chocolatey.licensed.dll.

On further testing, due to the fact that Chocolatey Licensed overrides some of the OSS cmdlets, without the chocolatey.licensed.dll in process, other OSS cmdlets also fail when something attempts to access them.

What is Expected?

The chocolatey.licensed.dll extension should be loaded during package installations in the PowerShell host, so that installers can utilise the licensed extension's cmdlets, as well as the overridden OSS cmdlets.

How Did You Get This To Happen? (Steps to Reproduce)

  1. Install Chocolatey v0.11.0
  2. Install chocolatey.extension v2.2.0
  3. Attempt to install chocolatey-agent v0.12.0
@vexx32 vexx32 added this to the 0.11.1 milestone Sep 2, 2021
@vexx32 vexx32 self-assigned this Sep 2, 2021
vexx32 added a commit to vexx32/choco that referenced this issue Sep 2, 2021
A prior change to avoid loading arbitrary DLLs incidentally also meant
we were not loading the chocolatey.licensed.dll during the installation
process.

This commit incorporates part of the original loading logic, cut down to
only look for and install the chocolatey.licensed.dll extension.
@gep13 gep13 linked a pull request Sep 2, 2021 that will close this issue
7 tasks
@gep13 gep13 changed the title chocolatey-agent install fails on v0.11.0 Chocolatey Licensed Extension is not loaded into PowerShell process when using v0.11.0 Sep 2, 2021
gep13 added a commit that referenced this issue Sep 2, 2021
…oads-during-install

(#2340) Ensure licensed extension is loaded during install when available
gep13 added a commit that referenced this issue Sep 2, 2021
* master:
  (maint) Reformat module file
  (#2340) Load licensed extension during installs
@gep13 gep13 added 4 - Done and removed 2 - Working labels Sep 2, 2021
@shmuelie
Copy link

shmuelie commented Sep 3, 2021

Having installed 0.11.0 I'm now "stuck". How do I fix this state?

@TheCakeIsNaOH
Copy link
Member

@shmuelie You should be able to do choco upgrade chocolatey again to get to 0.11.1. Unless you are using C4B and have a broken chocolatey-agent install due to this, in which case contacting support might be best.

@gep13
Copy link
Member

gep13 commented Sep 3, 2021

@shmuelie as @TheCakeIsNaOH mentioned, you should be able to upgrade to chocolatey 0.11.1. If that isn't working, then could you please grab the log file from the attempt and send that through in a support ticket (assuming you are a C4B customer).

@shmuelie
Copy link

shmuelie commented Sep 3, 2021

I have a pro license. After staring the problem for a bit, I removed my license file, was able to upgrade, and then reinstalled the license

@gep13
Copy link
Member

gep13 commented Sep 3, 2021

@shmuelie that is a surprise to know that this was required, as it wasn't necessary in the testing that I did before releasing 0.11.1. Would you mind sharing the log file for the installation attempt where it was failing for you? Thanks!

@shmuelie
Copy link

shmuelie commented Sep 3, 2021

I copied what I think are the relevant parts to Gist but if needed here's the whole log file: chocolatey.zip

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

Successfully merging a pull request may close this issue.

4 participants