jj addons folder

This commit is contained in:
JenneJ
2016-08-17 14:04:22 +02:00
parent 9aeb386a25
commit f0ce937585
5 changed files with 74 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
Imports System.ComponentModel
Imports System.IO
Public Class ClassInit
Public Sub New()
@@ -36,6 +37,43 @@ Public Class ClassInit
End Function
Public Sub InitAddons()
Try
Dim CurrentDir As String = My.Application.Info.DirectoryPath
Dim Sql As String = "SELECT PATH_ADDONS from TBPMO_KONFIGURATION WHERE GUID = 1"
Dim AddonPath As String = ClassDatabase.Execute_Scalar(Sql)
Dim Dev_AddonPath As String = System.IO.Path.GetFullPath(System.IO.Path.Combine(CurrentDir, "..\..\..\..\app"))
If AddonPath Is Nothing OrElse AddonPath = "" Then
' Addon Pfad in der Datenbank ist leer
Dim path = System.IO.Path.Combine(CurrentDir, "Addons")
Dim AddonDir As New DirectoryInfo(path)
If AddonDir.Exists Then
AddonPath = path
Else
AddonPath = Dev_AddonPath
End If
Else
' Addon Pfad steht in der Datenbank
Dim path = AddonPath
Dim AddonDir As New DirectoryInfo(path)
If (AddonDir.Exists) Then
AddonPath = path
Else
AddonPath = Dev_AddonPath
End If
End If
Sql = String.Format("UPDATE TBPMO_KONFIGURATION SET PATH_ADDONS = '{0}' WHERE GUID = 1", AddonPath)
ClassDatabase.Execute_non_Query(Sql)
Catch ex As Exception
MsgBox("Unexpected Error in InitAddons:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Public Sub InitBasics2()
Try
Dim configResult As Boolean