Skip to content

Commit

Permalink
(chocolatey#2078) Skip importing Chocolatey GUI Extension
Browse files Browse the repository at this point in the history
The Chocolatey GUI Extension is a "special" extension in the sense that
it isn't intended to work with Chocolatey directly, but it is shipped as
a "normal" Chocolatey extension. We don't want to load the
chocolateygui.licensed.dll into the choco.exe process, but rather leave
it alone, and allow Chocolatey GUI to load it when required.
  • Loading branch information
gep13 committed Apr 16, 2021
1 parent 5f0b6f7 commit de5b853
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/chocolatey.resources/helpers/chocolateyInstaller.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2017 Chocolatey Software, Inc.
# Copyright © 2015 - 2017 RealDimensions Software, LLC
# Copyright © 2011 - 2015 RealDimensions Software, LLC & original authors/contributors from https://github.com/chocolatey/chocolatey
#
Expand Down Expand Up @@ -73,7 +73,11 @@ if (Test-Path($extensionsPath)) {
}
}

if (!$loaded) { Import-Module $path; }
if (!$loaded) {
if ($fileNameWithoutExtension -ne "chocolateygui.licensed") {
Import-Module $path;
}
}
} catch {
if ($env:ChocolateyPowerShellHost -eq 'true') {
Write-Warning "Import failed for '$path'. Error: '$_'"
Expand Down

0 comments on commit de5b853

Please sign in to comment.