MS2
This commit is contained in:
@@ -31,6 +31,7 @@ Public Class ClassInit
|
|||||||
End Function
|
End Function
|
||||||
Public Sub InitBasics()
|
Public Sub InitBasics()
|
||||||
Try
|
Try
|
||||||
|
InitAddons()
|
||||||
Dim sql = String.Format("SELECT * FROM TBPMO_KONFIGURATION WHERE GUID = 1")
|
Dim sql = String.Format("SELECT * FROM TBPMO_KONFIGURATION WHERE GUID = 1")
|
||||||
Dim KONFIG_DT As DataTable = clsDatabase.Return_Datatable(sql, False)
|
Dim KONFIG_DT As DataTable = clsDatabase.Return_Datatable(sql, False)
|
||||||
If KONFIG_DT.Rows.Count = 1 Then
|
If KONFIG_DT.Rows.Count = 1 Then
|
||||||
@@ -81,5 +82,44 @@ Public Class ClassInit
|
|||||||
|
|
||||||
End Function
|
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 = MY_ADDON_PATH ' 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
|
||||||
|
If AddonDir.Name = "Addons" Then
|
||||||
|
AddonPath = path
|
||||||
|
Else
|
||||||
|
AddonPath = Dev_AddonPath
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
AddonPath = Dev_AddonPath
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
MY_ADDON_PATH = AddonPath
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Unexpected Error in InitAddons:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ Module ModuleMySettings
|
|||||||
Public VERSION_USER As String = "1.0.0.0"
|
Public VERSION_USER As String = "1.0.0.0"
|
||||||
Public FOLDER_TEMP As String
|
Public FOLDER_TEMP As String
|
||||||
Public LogErrorsOnly As Boolean = True
|
Public LogErrorsOnly As Boolean = True
|
||||||
|
Public MY_ADDON_PATH As String
|
||||||
|
|
||||||
Public Function LoadFileExclusion()
|
Public Function LoadFileExclusion()
|
||||||
Dim rowresult As String = ""
|
Dim rowresult As String = ""
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ Public Class frmVersionCheck
|
|||||||
End If
|
End If
|
||||||
Console.WriteLine(fri.Name)
|
Console.WriteLine(fri.Name)
|
||||||
Next fri
|
Next fri
|
||||||
|
Replace_Files()
|
||||||
|
|
||||||
Try
|
Try
|
||||||
'Delete the tempfolder and all data
|
'Delete the tempfolder and all data
|
||||||
System.IO.Directory.Delete(FOLDER_TEMP, True)
|
System.IO.Directory.Delete(FOLDER_TEMP, True)
|
||||||
@@ -94,6 +96,7 @@ Public Class frmVersionCheck
|
|||||||
' InitInterface wurde in frmMain integriert
|
' InitInterface wurde in frmMain integriert
|
||||||
'Init.InitInterface(mainForm)
|
'Init.InitInterface(mainForm)
|
||||||
System.Threading.Thread.Sleep(200)
|
System.Threading.Thread.Sleep(200)
|
||||||
|
Start_RO()
|
||||||
Else
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -101,10 +104,24 @@ Public Class frmVersionCheck
|
|||||||
' MsgBox("Unexpected Error in Init Classes: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
' MsgBox("Unexpected Error in Init Classes: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
'End Try
|
'End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
Sub Replace_Files()
|
||||||
|
Try
|
||||||
|
Dim ProductionPath As String = System.IO.Path.Combine(MY_ADDON_PATH, "Record Organizer")
|
||||||
|
Dim DevelPath As String = System.IO.Path.Combine(MY_ADDON_PATH, "DD-Record-Organiser\bin\Debug")
|
||||||
|
Dim COPY_FROM_PATH As String
|
||||||
|
If Directory.Exists(ProductionPath) Then
|
||||||
|
COPY_FROM_PATH = ProductionPath
|
||||||
|
Else
|
||||||
|
COPY_FROM_PATH = DevelPath
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("Unexpected Error in Replace_Files: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
Sub Start_RO()
|
Sub Start_RO()
|
||||||
Try
|
Try
|
||||||
Dim ProductionPath As String = System.IO.Path.Combine(MY_ADDON_PATH, "RightManager", "RecordOrganizer_RightManager.exe")
|
Dim ProductionPath As String = System.IO.Path.Combine(MY_ADDON_PATH, "Record Organizer", "DD-Record-Organiser.exe")
|
||||||
Dim DevelPath As String = System.IO.Path.Combine(MY_ADDON_PATH, "RecordOrganizer_RightManager\bin\Debug", "RecordOrganizer_RightManager.exe")
|
Dim DevelPath As String = System.IO.Path.Combine(MY_ADDON_PATH, "DD-Record-Organiser\bin\Debug", "DD-Record-Organiser.exe")
|
||||||
|
|
||||||
Dim startInfo As New ProcessStartInfo()
|
Dim startInfo As New ProcessStartInfo()
|
||||||
startInfo.Arguments = """" & MyConnectionString & """"
|
startInfo.Arguments = """" & MyConnectionString & """"
|
||||||
|
|||||||
Reference in New Issue
Block a user