You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are instances where .Net is not installed in a way that allows
Chocolatey CLI to function. In these scenarios, the version in the
registry seems to be very old. This commit accounts for this by wrapping
the container registration in a try cath, and displaying a descriptive
error in that case.
Additionally, this changes the check to use Registry64 instead of
Registry32, as on 64 bit systems the 64 bit registry is the one that
determines the .Net version. And the lookup on 32 bit systems gracefully
falls back to the 32 bit registry.
// We can't use chocolatey.StringResources as it is in both Chocolatey.PowerShell and chocolatey. This message is only reused within this class, so we're setting it here.
54
+
privateconststringDotNetDownload=@"
55
+
Please install .NET Framework 4.8 manually and reboot the system.
56
+
Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'";
// We have encountered an irrecoverable error before program information would be displayed. So we're going to display it as best we can. Regardless of if they wanted regular output or not, they're getting it.
87
+
DisplayProgramInformation(
88
+
true,
89
+
args,
90
+
VersionInformation.GetCurrentInformationalVersion(),// We don't have a configuration object yet. This is the same way that ConfigurationBuilder generates this version.
91
+
license
92
+
);
93
+
"chocolatey".Log().Error(ChocolateyLoggers.Important,@"Container registration encountered an irrecoverable error.
94
+
It could be that .NET 4.8 may be corrupted, or may be a really old version.{0}".FormatWith(DotNetDownload));
@".NET 4.8 is not installed or may need a reboot to complete installation.
337
-
Please install .NET Framework 4.8 manually and reboot the system.
338
-
Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'"
339
-
.FormatWith(Environment.NewLine));
356
+
thrownewApplicationException(".NET 4.8 is not installed or may need a reboot to complete installation.{0}".FormatWith(DotNetDownload));
0 commit comments