-
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
(#2738) Check installed .NET version installed is at least 4.8 #2935
(#2738) Check installed .NET version installed is at least 4.8 #2935
Conversation
95b39d1
to
dff4453
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! I have left some comments/questions.
@TheCakeIsNaOH am I right in saying that even with this change in place, there is still an error when running on .NET Framework 4.5.1? i.e. we don't see this actual error that we want to throw? |
@TheCakeIsNaOH @AdmiringWorm are there any tests that we can do around this change? Or do we not think that they are required? |
Correct, the error is about the |
63351b5
to
62d05c7
Compare
Could perhaps be possible to do this as part of the E2E tests, but that would require manipulating the registry as part of the initialization (and restoring it once the test has run). I think @corbob may be in a better position to answer that though since I think he has experience with manipulating the necessary part of the registry. |
62d05c7
to
abeb893
Compare
The All of that to say: If we can get permissions to the registry keys needed, there's no reason we shouldn't have an E2E test to cover it, but I'm not aware of automated ways to set the permissions. In case anyone decides to look at regini: https://learn.microsoft.com/en-US/troubleshoot/windows-client/application-management/change-registry-values-permissions |
Yes, it is possible. I have some internal packages that take ownership from trusted installer to set registry keys. The trick is adjust token privileges to add the And there is an example here of how to take ownership: This code has been bouncing around for a while, so I would expect there to be lots of other examples. |
This adds a registry check to chocolatey.console to validate that .Net 4.8 or later is installed. This check is added because Chocolatey CLI can start to execute but runs into errors when the system has an older version of .Net framework installed. The check is very early on in the execution so as to print out a helpful error before any errors due to incompatibilities with the older .Net version show up.
abeb893
to
bfd4176
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@TheCakeIsNaOH thanks for getting this added! |
Description Of Changes
This adds a registry check to
chocolatey.console
to validate that .Net 4.8 or later is installed. This check is added because Chocolatey CLI can start to execute but runs into errors when the system has an older version of .Net framework installed. The check is very early on in the execution so as to print out a helpful error before any errors due to incompatibilities with the older .Net version show up.Motivation and Context
It is better to have a check and helpful message than various unhelpful error messages.
Testing
choco
commands cause an error (which happens too early in execution for a check to be added)choco
commands print out the error messaged added in this PRchoco
commands do not trigger the error messaged added in this PRAdditionally, test on Windows 10 with .Net 4.8 installed that
choco
commands do not trigger the error messaged added in this PROperating Systems Testing
Change Types Made
Change Checklist
Related Issue
Part of #2738
https://app.clickup.com/t/20540031/PROJ-368