diff --git a/app/DD-Record-Organiser/ClassInit.vb b/app/DD-Record-Organiser/ClassInit.vb index ba38ae7..3e011a1 100644 --- a/app/DD-Record-Organiser/ClassInit.vb +++ b/app/DD-Record-Organiser/ClassInit.vb @@ -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 diff --git a/app/DD-Record-Organiser/ModuleHelperMethods.vb b/app/DD-Record-Organiser/ModuleHelperMethods.vb index 060d868..ce12b78 100644 --- a/app/DD-Record-Organiser/ModuleHelperMethods.vb +++ b/app/DD-Record-Organiser/ModuleHelperMethods.vb @@ -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() diff --git a/app/DD-Record-Organiser/frmSplash.vb b/app/DD-Record-Organiser/frmSplash.vb index 19f260c..686159c 100644 --- a/app/DD-Record-Organiser/frmSplash.vb +++ b/app/DD-Record-Organiser/frmSplash.vb @@ -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) diff --git a/app/SetupWiX/Product.wxs b/app/SetupWiX/Product.wxs index d12d009..5b10c36 100644 --- a/app/SetupWiX/Product.wxs +++ b/app/SetupWiX/Product.wxs @@ -63,7 +63,19 @@ - + + + + + + + + + + + + + @@ -239,6 +251,7 @@ + diff --git a/app/SetupWiX/SetupWiX.wixproj b/app/SetupWiX/SetupWiX.wixproj index 19d732c..12241e4 100644 --- a/app/SetupWiX/SetupWiX.wixproj +++ b/app/SetupWiX/SetupWiX.wixproj @@ -17,7 +17,9 @@ bin\$(Configuration)\ obj\$(Configuration)\ Debug - -b "$(SolutionDir)DD-Record-Organiser\bin\Debug" -b "$(SolutionDir)DD-Record-Organiser\bin\Release" -cultures:de-DE,en-GB,en-US + -b "$(SolutionDir)DD-Record-Organiser\bin\$(Configuration)" -b "$(SolutionDir)RecordOrganizer_RightManager\bin\$(Configuration)" -cultures:de-DE,en-GB,en-US + + bin\$(Configuration)\