@@ -41,52 +41,52 @@ Inherits Application
4141
4242 #tag MenuHandler
4343 Function AboutBox() As Boolean Handles AboutBox.Action
44- AboutBoxWindow.Show
45- Return True
46-
44+ AboutBoxWindow.Show
45+ Return True
46+
4747 End Function
4848 #tag EndMenuHandler
4949
5050 #tag MenuHandler
5151 Function ServerConnect() As Boolean Handles ServerConnect.Action
52- ConnectWindow.Show
53- Return True
54-
52+ ConnectWindow.Show
53+ Return True
54+
5555 End Function
5656 #tag EndMenuHandler
5757
5858 #tag MenuHandler
5959 Function ServerGetaDeveloperKey() As Boolean Handles ServerGetaDeveloperKey.Action
60- ShowURL "https://www.sqlabs.com/cubesql_devkey.php"
61- Return True
62-
60+ ShowURL "https://www.sqlabs.com/cubesql_devkey.php"
61+ Return True
62+
6363 End Function
6464 #tag EndMenuHandler
6565
6666
6767 #tag Method, Flags = &h21
6868 Private Function GetErrorDesc(err As RuntimeException) As String
69- If err IsA NilObjectException then
70- return "Nil Object Exception"
71- elseif err IsA OutOfBoundsException then
72- return "Out of Bounds"
73- elseif err IsA TypeMismatchException then
74- return "Type Mismatch"
75- elseif err IsA illegalCastException then
76- return "llegal Cast"
77- elseif err IsA InvalidParentException then
78- return "Invalid Parent"
79- elseif err IsA KeyNotFoundException then
80- return "Key Not Found Exception"
81- elseif err IsA OutOfMemoryException then
82- return "Out Of Memory"
83- elseif err IsA StackOverflowException then
84- return "Stack Overflow"
85- elseif err IsA ThreadAlreadyRunningException then
86- return "Thread Already Running"
87- else
88- return "Unknown error"
89- end if
69+ If err IsA NilObjectException Then
70+ Return "Nil Object Exception"
71+ ElseIf err IsA OutOfBoundsException Then
72+ Return "Out of Bounds"
73+ ElseIf err IsA TypeMismatchException Then
74+ Return "Type Mismatch"
75+ ElseIf err IsA illegalCastException Then
76+ Return "llegal Cast"
77+ ElseIf err IsA InvalidParentException Then
78+ Return "Invalid Parent"
79+ ElseIf err IsA KeyNotFoundException Then
80+ Return "Key Not Found Exception"
81+ ElseIf err IsA OutOfMemoryException Then
82+ Return "Out Of Memory"
83+ ElseIf err IsA StackOverflowException Then
84+ Return "Stack Overflow"
85+ ElseIf err IsA ThreadAlreadyRunningException Then
86+ Return "Thread Already Running"
87+ Else
88+ Return "Unknown error"
89+ End If
9090
9191
9292 End Function
@@ -95,43 +95,67 @@ Inherits Application
9595 #tag Method, Flags = &h21
9696 Private Function GetLinuxLibrary(psName As String ) As FolderItem
9797 # If TargetLinux Then
98- Dim systemLibs_Folders() As String
99- Dim systemLibs_Filenames() As String
98+ Dim sLibraryFolders() As String
99+ Dim sLibraryFilenames() As String
100+
101+ 'OpenSSL Versions: CubeSQLPlugin supports OpenSSL 1.1 and older
102+ '1st: try to find OpenSSL 1.1 from the system
103+ sLibraryFilenames.Append(psName + ".so.1.1" )
104+ '2nd: try to find older OpenSSL versions from the system
105+ sLibraryFilenames.Append(psName + ".so.1.0.2" )
106+ sLibraryFilenames.Append(psName + ".so.1.0.0" )
107+ sLibraryFilenames.Append(psName + ".so.0.9.8" )
108+ '3rd: this is usually a symlink and might point to a version not supported by CubeSQLPlugin
109+ sLibraryFilenames.Append(psName + ".so" )
100110
101- systemLibs_Filenames.Append(psName + ".so.1.1" )
102- systemLibs_Filenames.Append(psName + ".so.1.0.2" )
103- systemLibs_Filenames.Append(psName + ".so.1.0.0" )
104- systemLibs_Filenames.Append(psName + ".so.0.9.8" )
105- systemLibs_Filenames.Append(psName + ".so" ) 'is usually a symlink, but might point to non supported version by CubeSQLPlugin
111+ 'OpenSSL Library location
112+ Try
113+ '1st: try OpenSSL manually added to this application
114+ Dim oSSLAdminPath As FolderItem = Prefs.SSLAdminPath
115+ If (oSSLAdminPath <> Nil) And oSSLAdminPath.Exists And oSSLAdminPath.Directory Then
116+ sLibraryFolders.Append(oSSLAdminPath.NativePath)
117+ End If
118+
119+ '2nd: try OpenSSL bundled with this application
120+ sLibraryFolders.Append(App.ExecutableFile.Parent.Child(App.ExecutableFile.Name + " Libs" ).NativePath)
121+ sLibraryFolders.Append(App.ExecutableFile.Parent.NativePath)
122+ Catch err As RuntimeException
123+ 'ignore and continue
124+ End Try
106125
126+ '3rd: try to find OpenSSL on the system
107127 # If Target32Bit Then
108128 # If TargetARM Then
109- systemLibs_Folders .Append("/lib/arm-linux-gnueabihf/" )
110- systemLibs_Folders .Append("/usr/lib/arm-linux-gnueabihf/" )
129+ sLibraryFolders .Append("/lib/arm-linux-gnueabihf/" )
130+ sLibraryFolders .Append("/usr/lib/arm-linux-gnueabihf/" )
111131 # EndIf
112- systemLibs_Folders .Append("/lib/i386-linux-gnu/" )
113- systemLibs_Folders .Append("/usr/lib/i386-linux-gnu/" )
114- systemLibs_Folders .Append("/lib32/" )
115- systemLibs_Folders .Append("/usr/lib32/" )
132+ sLibraryFolders .Append("/lib/i386-linux-gnu/" )
133+ sLibraryFolders .Append("/usr/lib/i386-linux-gnu/" )
134+ sLibraryFolders .Append("/lib32/" )
135+ sLibraryFolders .Append("/usr/lib32/" )
116136 # EndIf
117137 # If Target64Bit Then
118138 # If TargetARM Then
119139 #Pragma Error "SSL Library locations has not been implemented yet for this BuildTarget"
120140 # EndIf
121- systemLibs_Folders .Append("/lib/x86_64-linux-gnu/" )
122- systemLibs_Folders .Append("/usr/lib/x86_64-linux-gnu/" )
123- systemLibs_Folders .Append("/lib64/" )
124- systemLibs_Folders .Append("/usr/lib64/" )
141+ sLibraryFolders .Append("/lib/x86_64-linux-gnu/" )
142+ sLibraryFolders .Append("/usr/lib/x86_64-linux-gnu/" )
143+ sLibraryFolders .Append("/lib64/" )
144+ sLibraryFolders .Append("/usr/lib64/" )
125145 # EndIf
126146
127- systemLibs_Folders .Append("/lib/" )
128- systemLibs_Folders .Append("/usr/lib/" )
147+ sLibraryFolders .Append("/lib/" )
148+ sLibraryFolders .Append("/usr/lib/" )
129149
130150 Dim oFile As FolderItem
131- For Each sSystemLibsFolder As String In systemLibs_Folders
132- For Each sSystemLibsFilename As String In systemLibs_Filenames
133- oFile = GetFolderItem(sSystemLibsFolder + sSystemLibsFilename, FolderItem.PathTypeShell)
134- If (oFile <> Nil) And ( Not oFile.Directory) And oFile.Exists Then Return oFile
151+ For Each sSystemLibsFolder As String In sLibraryFolders
152+ For Each sSystemLibsFilename As String In sLibraryFilenames
153+ Try
154+ oFile = GetFolderItem(sSystemLibsFolder + sSystemLibsFilename, FolderItem.PathTypeShell)
155+ If (oFile <> Nil) And ( Not oFile.Directory) And oFile.Exists Then Return oFile
156+ Catch err As RuntimeException
157+ 'ignore and continue
158+ End Try
135159 Next
136160 Next
137161
@@ -149,7 +173,7 @@ Inherits Application
149173
150174 # If TargetMacOS Then
151175 'SSL Library is included in CubeSQLPlugin
152- return
176+ Return
153177
154178 # ElseIf TargetWindows Then
155179 'Try to locate the SSL Library in these folders
@@ -194,6 +218,7 @@ Inherits Application
194218 # EndIf
195219
196220 If (SSLLibFile = Nil) Or (CryptoLibFile = Nil) Then Return
221+ If SSLLibFile.Directory Or CryptoLibFile.Directory Then Return
197222 If ( Not SSLLibFile.Exists) Or ( Not CryptoLibFile.Exists) Then Return
198223
199224 'set SSL Library for CubeSQLPlugin
0 commit comments