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

Synchronized packages with DLLs are attempted to be imported by Chocolatey's PowerShell Extensions Loader #1041

Closed
ferventcoder opened this issue Nov 8, 2016 · 2 comments

Comments

@ferventcoder
Copy link
Member

A package getting synchronized will have a backup created under C:\ProgramData\chocolatey\extensions\chocolatey\lib-synced. The extensions folder is scanned for PowerShell modules to load up PowerShell module extensions for Chocolatey to be used in the automation scripts. However this folder should be explicitly ignored.

@ferventcoder
Copy link
Member Author

A workaround now is to delete folders under c:\ProgramData\chocolatey\extensions\chocolatey\lib-synced for now until 0.10.4 is released to address this issue or it is addressed in another way.

ferventcoder added a commit to ferventcoder/choco that referenced this issue Jan 4, 2017
When Chocolatey loads the extensions folders, sometimes it is getting
caught by the synced folder that may contain DLLs. In newer licensed
versions, this synced folder is kept in a better location, but those
older versions need a way of ensuring that those DLLs are not attempted
to be loaded up.
ferventcoder added a commit that referenced this issue Jan 4, 2017
* stable:
  (GH-1117) Get-ChocolateyWebFile - Url Overrides
  (maint) Do not error on missing SMA dll resources
  (GH-1126) Start-ChocolateyProcess no elevate when admin
  (GH-1013) PowerShell external - set debug/verbose false
  (maint) Fix: PackageResult Errors if DownloadUrl is Null
  (maint) formatting
  (GH-1121) API - Do not reset loggers
  (GH-1041) Fix: Skip loading synced dlls as extensions
  (GH-1013) PowerShell - Only import installer module
  (GH-1118) Feature to disable non-elevated warnings
  (maint)(log) Show Formatted Download Progress Only
  (GH-1035) Auto Uninstaller Skip if File Doesn't Exist
  (GH-1119) Auto Uninstaller - Allow remove directly
  (build) change message
  (doc) explain upgrading licensed version
ferventcoder added a commit that referenced this issue Jan 4, 2017
* stable:
  (GH-1041) Fix bad PowerShell script
Apteryx0 pushed a commit to Apteryx0/choco that referenced this issue Jan 23, 2017
When Chocolatey loads the extensions folders, sometimes it is getting
caught by the synced folder that may contain DLLs. In newer licensed
versions, this synced folder is kept in a better location, but those
older versions need a way of ensuring that those DLLs are not attempted
to be loaded up.
Apteryx0 pushed a commit to Apteryx0/choco that referenced this issue Jan 23, 2017
@ferventcoder
Copy link
Member Author

ferventcoder commented Aug 24, 2021

Related to #2078

vexx32 pushed a commit to vexx32/choco that referenced this issue Aug 30, 2021
As there isn't a way to determine whether a DLL is a usable PowerShell
module without loading it into memory, we're better off not loading DLLs
directly, as it has caused issues several times in the past
(see: chocolatey#2078, chocolatey#1041).
This has previously required us to create an ever-expanding list of
exceptions to the loading behaviour.

Instead, if folks want to load DLLs as powershell modules, they can
package them alongside a PSM1 file that handles the DLL import itself.
This removes the need for Chocolatey to guess which dlls are powershell
modules and which should not be loaded.
gep13 pushed a commit to vexx32/choco that referenced this issue Sep 2, 2021
As there isn't a way to determine whether a DLL is a usable PowerShell
module without loading it into memory, we're better off not loading DLLs
directly, as it has caused issues several times in the past
(see: chocolatey#2078, chocolatey#1041).
This has previously required us to create an ever-expanding list of
exceptions to the loading behaviour.

Instead, if folks want to load DLLs as powershell modules, they can
package them alongside a PSM1 file that handles the DLL import itself.
This removes the need for Chocolatey to guess which dlls are powershell
modules and which should not be loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants