-
Notifications
You must be signed in to change notification settings - Fork 907
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 CLI tries to load the licensed environment settings when the licensed extension assembly is not supposed to be loaded #3224
Comments
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 25, 2023
When determining if Chocolatey is licensed, we previously just checked for the license being valid. This leads to inadvertently treating the licensed assembly as fully loaded even if it isn't loaded. This commit updates the logic to validate the assembly is loaded as well. If we have a valid license, and we have loaded the assembly, then we should consider to be licensed.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 25, 2023
Previously the version check would assume that all of the output from `choco --version` should be considered as part of the version. However, if the licensed assembly reports it's not valid, it does so very early in the process, and outputs on this command before the version is output. In order to work around this, the command to get the running version should get just the very last line it's returned.
10 tasks
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 26, 2023
Previously the version check would assume that all of the output from `choco --version` should be considered as part of the version. However, if the licensed assembly reports it's not valid, it does so very early in the process, and outputs on this command before the version is output. In order to work around this, the command to get the running version should get just the very last line it's returned.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 26, 2023
When we're checking for license features, we should be also checking if the licensed assembly is loaded. When the licensed assembly is not fully loaded, many features may not work, or are not expected to be used. As such, this commit updates the logic to check for a valid license as well as the Assembly to be loaded so that we don't accidentally cause issues when the assembly is not being used.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 26, 2023
There is logic in the Install and Upgrade commands that will throw an error if certain licensed parameters are passed in to the command. This adds a test to ensure that the exception is thrown. This will allow us to test that it behaves the same when the assembly is not loaded.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 26, 2023
In order to determine if the Licensed Assembly has been loaded, we either need to validate the license every time, or add it somewhere that we can access more easily. This commit adds a `IsLicensedAssemblyLoaded` boolean to the `InformationCommand` property of `ChocolateyConfiguration` beside `IsLicensedVersion` so that we can reference this property instead of validating the license every time.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 27, 2023
There is logic in the Install and Upgrade commands that will throw an error if certain licensed parameters are passed in to the command. This adds a test to ensure that the exception is thrown. This will allow us to test that it behaves the same when the assembly is not loaded.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 27, 2023
In order to determine if the Licensed Assembly has been loaded, we either need to validate the license every time, or add it somewhere that we can access more easily. This commit adds a `IsLicensedAssemblyLoaded` boolean to the `InformationCommand` property of `ChocolateyConfiguration` beside `IsLicensedVersion` so that we can reference this property instead of validating the license every time.
gep13
changed the title
Chocolatey CLI tries to load the Licensed Environment settings even when the licensed extension assembly is not supposed to be loaded.
Chocolatey CLI tries to load the licensed environment settings when the licensed extension assembly is not supposed to be loaded
Jun 27, 2023
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 27, 2023
Previously the version check would assume that all of the output from `choco --version` should be considered as part of the version. However, if the licensed assembly reports it's not valid, it does so very early in the process, and outputs on this command before the version is output. In order to work around this, the command to get the running version should get just the very last line it's returned.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 27, 2023
There is logic in the Install and Upgrade commands that will throw an error if certain licensed parameters are passed in to the command. This adds a test to ensure that the exception is thrown. This will allow us to test that it behaves the same when the assembly is not loaded.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 27, 2023
In order to determine if the Licensed Assembly has been loaded, we either need to validate the license every time, or add it somewhere that we can access more easily. This commit adds a `IsLicensedAssemblyLoaded` boolean to the `InformationCommand` property of `ChocolateyConfiguration` beside `IsLicensedVersion` so that we can reference this property instead of validating the license every time. Additionally when we're checking for license features, we should be also checking if the licensed assembly is loaded. When the licensed assembly is not fully loaded, many features may not work, or are not expected to be used. As such, this commit updates the logic to check for a valid license as well as the Assembly to be loaded so that we don't accidentally cause issues when the assembly is not being used.
corbob
added a commit
to corbob/choco
that referenced
this issue
Jun 27, 2023
In order to determine if the Licensed Assembly has been loaded, we either need to validate the license every time, or add it somewhere that we can access more easily. This commit adds a `IsLicensedAssemblyLoaded` boolean to the `InformationCommand` property of `ChocolateyConfiguration` beside `IsLicensedVersion` so that we can reference this property instead of validating the license every time. Additionally when we're checking for license features, we should be also checking if the licensed assembly is loaded. When the licensed assembly is not fully loaded, many features may not work, or are not expected to be used. As such, this commit updates the logic to check for a valid license as well as the Assembly to be loaded so that we don't accidentally cause issues when the assembly is not being used.
AdmiringWorm
added a commit
that referenced
this issue
Jun 27, 2023
(#3224) Do not try to use the Licensed Assembly when it is not loaded for compatibility reasons.
gep13
added a commit
that referenced
this issue
Jun 29, 2023
* release/2.1.0: (52 commits) (maint) If statement formatting change (#3224) Add Assembly Loaded configuration option (maint) Resave without BOM (#3224) Update version check tests (#3174) Store non-normalized package version (maint) Add required whitespace (#3225) Add Pester Tests to ensure environment (#3201 #3225) Re-instate setting of config values (maint) Remove env variable for release version (maint) Fix encoding of file (#3194) Add tab completion for cache command (#2854) Re-save file with UTF-8 with BOM (#3218) Update Tab Expansion to use Test-Path (#3218) Remove try catch block for tab completion (build) Use latest Chocolatey.Cake.Recipe package (#2854) Do Write-Error instead of Write-Warning (#2854) Pester tests to Get-ChocolateyConfigValue (maint) Resave Get-ChocolateyConfigValue as CRLF (#2854) Add helper to read config values (#3214) Add Pester tests to ensure cache cleared ...
🎉 This issue has been resolved in version 2.1.0 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
gep13
added a commit
that referenced
this issue
Jun 29, 2023
* master: (maint) If statement formatting change (#3224) Add Assembly Loaded configuration option (maint) Resave without BOM (#3224) Update version check tests (#3174) Store non-normalized package version (maint) Add required whitespace (#3225) Add Pester Tests to ensure environment (#3201 #3225) Re-instate setting of config values (maint) Remove env variable for release version (maint) Fix encoding of file (#3194) Add tab completion for cache command (#2854) Re-save file with UTF-8 with BOM (#3218) Update Tab Expansion to use Test-Path (#3218) Remove try catch block for tab completion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
What You Are Seeing?
When you have an incompatible version of Chocolatey Licensed Extension, the Environment is still attempted to be set by the licensed extension.
What is Expected?
The Licensed Extension should not be called unless the user explicitly asks for it.
How Did You Get This To Happen?
System Details
Installed Packages
Output Log
Additional Context
Here is a screenshot with a custom CLI as well:
The text was updated successfully, but these errors were encountered: