This commit is contained in:
Digital Data - Marlon Schreiber
2017-04-12 13:48:22 +02:00
parent 8c901be00c
commit 292b241fd1
38 changed files with 1445 additions and 1114 deletions

View File

@@ -31,7 +31,6 @@ Public Class ClassInit
End Function
Public Sub InitBasics()
Try
Dim UPDATE_ID As Integer
If InitInstallPath() = False Then
End If
@@ -48,6 +47,7 @@ Public Class ClassInit
VERSION_SERVER = DT_UPDATE.Rows(0).Item("VERSION_NO")
FORCE_UPDATE = DT_UPDATE.Rows(0).Item("FORCE_UPD")
VERSIONS_FOR_FORCE_UPDATE = DT_UPDATE.Rows(0).Item("VERSION_FORCE_UPD")
ALL_USERS = DT_UPDATE.Rows(0).Item("ALL_USERS")
sql = String.Format("SELECT * FROM TBDD_VERSION_ITEMS WHERE UPDATE_ID = {0} ORDER BY GUID", UPDATE_ID)
DT_UPDATE_ITEMS = clsDatabase.Return_Datatable(sql)
End If
@@ -120,7 +120,6 @@ Public Class ClassInit
Return False
End If
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in InitInstallPath: " & ex.Message, True)
Return False
@@ -131,19 +130,22 @@ Public Class ClassInit
Dim f As String
Try
For Each d In Directory.GetDirectories(sDir)
If RecExe_found = False Then
For Each f In Directory.GetFiles(d, "DD-Record-Organizer.exe")
RecExe_found = True
MY_INSTALL_PATH = Path.GetDirectoryName(f)
Exit Sub
Next
End If
If RecExe_found = False Then
DirSearch(d)
If d.Contains("$Recycle") = False Or d.Contains("System Volume") = False Then
If RecExe_found = False Then
For Each f In Directory.GetFiles(d, "DD-Record-Organizer.exe")
RecExe_found = True
MY_INSTALL_PATH = Path.GetDirectoryName(f)
Exit Sub
Next
End If
If RecExe_found = False Then
DirSearch(d)
End If
End If
Next
Catch excpt As System.Exception
ClassLogger.Add("Unexpected Error in DirSearch: " & excpt.Message, True)
MY_INSTALL_PATH = ""
End Try
End Sub
Public Shared Function InsertEssential_Log(REFERENCE_KEY As Integer, REFERENCE_STRING As String, COMMENT As String)

View File

@@ -62,10 +62,15 @@ Public Class ClassLogger
Try
If ACHTUNG Then
ClassLogger.StreamWriter.WriteLine("#ERROR# (" & System.DateTime.Now & "): " & information)
ERROR_WHILE_UPDATING = True
If (information.Contains("Der Zugriff auf den Pfad")) Then
Else
ERROR_WHILE_UPDATING = True
End If
Else
ClassLogger.StreamWriter.WriteLine(information)
ClassLogger.StreamWriter.WriteLine(information)
End If
ClassLogger.CloseFile()
Catch e As Exception

View File

@@ -15,6 +15,8 @@ Module ModuleMySettings
Public VERSION_SERVER = "1.0.0.0"
Public VERSION_USER = "1.0.0.0"
Public FORCE_UPDATE As Boolean = False
Public UPDATE_ID As Integer
Public ALL_USERS As Boolean = False
Public VERSIONS_FOR_FORCE_UPDATE As String = ""
Public FOLDER_TEMP As String
Public LogErrorsOnly As Boolean = True

View File

@@ -56,6 +56,13 @@ Public Class frmVersionCheck
End If
End If
If FORCE_UPDATE = False Then
If ALL_USERS = False Then
Dim sql = String.Format("SELECT COUNT(GUID) FROM TBDD_VERSION_USER_UPDATE WHERE USER_ID = {0} AND UPDATE_ID = {1}", USER_GUID, UPDATE_ID)
If clsDatabase.Execute_Scalar(sql) = 0 Then
ClassInit.InsertEssential_Log(USER_GUID, "USER-ID", String.Format("VersionChecker: User is not part of update-group - UPDATE-ID: {0}", UPDATE_ID))
Exit Sub
End If
End If
Dim msg = "Auf dem Server liegt ein Update für ADDI bereit!" & vbNewLine & "Wollen Sie das Update nun durchführen? Die Dauer ist abhängig von Ihrer Netzwerkverbindung!"
If USER_LANGUAGE <> "de-DE" Then
msg = "There is a new release available for ADDI!" & vbNewLine & "Would You like to install the update now? This might take some minutes!"
@@ -258,6 +265,8 @@ Public Class frmVersionCheck
Process.Start(startInfo)
Else
MsgBox("Can not find ADDI-Executable in regular path! Please inform your systemadmin.", MsgBoxStyle.Critical)
startInfo.FileName = "E:\SchreiberM\Visual Studio\GIT\RecordOrganizer\app\DD-Record-Organizer\bin\Debug\DD-Record-Organizer.exe"
Process.Start(startInfo)
End If
Catch ex As Exception