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

View File

@@ -340,9 +340,19 @@
frm.Show()
End Sub
Public Sub OpenRightsmanager()
Dim path = ClassDatabase.Execute_Scalar("SELECT PATH_ADDONS FROm TBPMO_KONFIGURATION WHERE GUID = 1")
Dim startInfo As New ProcessStartInfo(path & "\RecordOrganizer_RightManager.exe")
Dim path As String = ClassDatabase.Execute_Scalar("SELECT PATH_ADDONS FROm TBPMO_KONFIGURATION WHERE GUID = 1")
Dim ProductionPath As String = System.IO.Path.Combine(path, "RightManager", "RecordOrganizer_RightManager.exe")
Dim DevelPath As String = System.IO.Path.Combine(path, "RecordOrganizer_RightManager\bin\Debug", "RecordOrganizer_RightManager.exe")
Dim startInfo As New ProcessStartInfo()
startInfo.Arguments = """" & MyConnectionString & """"
If System.IO.File.Exists(ProductionPath) Then
startInfo.FileName = ProductionPath
Else
startInfo.FileName = DevelPath
End If
Process.Start(startInfo)
End Sub
Public Sub OpenWindream_Files()

View File

@@ -4,7 +4,7 @@ Public NotInheritable Class frmSplash
'TODO: Dieses Formular kann einfach als Begrüßungsbildschirm für die Anwendung festgelegt werden, indem Sie zur Registerkarte "Anwendung"
' des Projekt-Designers wechseln (Menü "Projekt", Option "Eigenschaften").
Private InitSteps As Integer = 5
Private InitSteps As Integer = 6
Private bw As New BackgroundWorker()
Private mainForm As Form
@@ -81,9 +81,14 @@ Public NotInheritable Class frmSplash
ERROR_INIT = "INVALID USER"
End If
System.Threading.Thread.Sleep(300)
bw.ReportProgress(CalcProgress(5), "Initializing Addons")
Init.InitAddons()
System.Threading.Thread.Sleep(500)
bw.ReportProgress(CalcProgress(5), "Initializing Frontend")
bw.ReportProgress(CalcProgress(6), "Initializing Frontend")
' InitInterface wurde in frmMain integriert
'Init.InitInterface(mainForm)