Browse Source

NativeDependencyCompatibilityChecker: removed hint functionality

Marcin Ziąbek 10 months ago
parent
commit
0c655459da

+ 1 - 7
Source/QuestPDF/Helpers/NativeDependencyCompatibilityChecker.cs

@@ -9,8 +9,7 @@ namespace QuestPDF.Helpers
         private bool IsCompatibilityChecked { get; set; } = false;
 
         public Action ExecuteNativeCode { get; set; } = () => { };
-        public Func<string> ExceptionHint { get; set; } = () => string.Empty;
-        
+
         public void Test()
         {
             if (IsCompatibilityChecked)
@@ -68,11 +67,6 @@ namespace QuestPDF.Helpers
                 if (RuntimeInformation.ProcessArchitecture is Architecture.Arm)
                     message += $"{paragraph}Please consider setting the 'Platform target' property to 'Arm64' in your project settings.";
 
-                var hint = ExceptionHint.Invoke();
-                
-                if (!string.IsNullOrEmpty(hint))
-                    message += $"{paragraph}{hint}";
-
                 if (isRuntimeSupported)
                     message += $"{paragraph}If the problem persists, it may mean that your current operating system distribution is outdated. For optimal compatibility, please consider updating it to a more recent version.";
                 

+ 1 - 22
Source/QuestPDF/Qpdf/QpdfNativeDependencyCompatibilityChecker.cs

@@ -7,8 +7,7 @@ internal static class QpdfNativeDependencyCompatibilityChecker
 {
     private static NativeDependencyCompatibilityChecker Instance { get; } = new()
     {
-        ExecuteNativeCode = ExecuteNativeCode,
-        ExceptionHint = GetHint
+        ExecuteNativeCode = ExecuteNativeCode
     };
     
     public static void Test()
@@ -23,24 +22,4 @@ internal static class QpdfNativeDependencyCompatibilityChecker
         if (string.IsNullOrEmpty(qpdfVersion))
             throw new Exception();
     }
-
-    private static string GetHint()
-    {
-        var platform = NativeDependencyProvider.GetRuntimePlatform();
-        
-        if (!platform.StartsWith("linux"))
-            return string.Empty;
-        
-        var command = platform switch
-        {
-            "linux-x64" or "linux-arm64" => "apt install openssl libjpeg-turbo8",
-            "linux-musl-x64" => "apk add openssl libjpeg-turbo",
-            _ => throw new NotSupportedException()
-        };
-        
-        const string openSslHint = "Please also ensure that the OpenSSL library is installed on your system with version at least 3.0.0.";
-        const string qpdfHint = "Do NOT install the qpdf package.";
-        
-        return $"Installing additional dependencies may help. Please try the following command: '{command}'. {openSslHint} {qpdfHint}";
-    }
 }