MS V2.7 .Net Logger etc
This commit is contained in:
@@ -47,14 +47,14 @@ Public Class ClassUpdate
|
||||
ALL_USERS = DT_UPDATE.Rows(0).Item("ALL_USERS")
|
||||
sql = String.Format("SELECT * FROM TBDD_VERSION_ITEMS WHERE UPDATE_ID = {0} AND [INFO1] IS NOT NULL ORDER BY GUID", UPDATE_ID)
|
||||
DT_UPDATE_ITEMS = clsDatabase.Return_Datatable(sql)
|
||||
ClassLogger.Add(String.Format("{0} items need to be updated!", DT_UPDATE_ITEMS.Rows.Count.ToString), False)
|
||||
LOGGER.Info(String.Format("{0} items need to be updated!", DT_UPDATE_ITEMS.Rows.Count.ToString))
|
||||
Else
|
||||
ClassLogger.Add(">> No Updates Configured!", False)
|
||||
LOGGER.Info("No Updates Configured!")
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in ClassUpdate - Init: " & ex.Message, True)
|
||||
LOGGER.Warn("Unexpected Error in ClassUpdate - Init: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
@@ -73,12 +73,12 @@ Public Class ClassUpdate
|
||||
End If
|
||||
Next
|
||||
If RecExe_found = False Then
|
||||
ClassLogger.Add("Could not find the path for RecordOrganizer", True)
|
||||
LOGGER.Warn("Could not find the path for RecordOrganizer")
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in InitInstallPath: " & ex.Message, True)
|
||||
LOGGER.Warn("Unexpected Error in InitInstallPath: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
@@ -101,7 +101,7 @@ Public Class ClassUpdate
|
||||
End If
|
||||
Next
|
||||
Catch excpt As System.Exception
|
||||
ClassLogger.Add("Unexpected Error in DirSearch: " & excpt.Message, True)
|
||||
LOGGER.Warn("Unexpected Error in DirSearch: " & excpt.Message)
|
||||
MY_INSTALL_PATH = ""
|
||||
End Try
|
||||
End Sub
|
||||
@@ -112,7 +112,7 @@ Public Class ClassUpdate
|
||||
sql = String.Format("SELECT * FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('{0}'))", USER_USERNAME)
|
||||
Dim USER_DT As DataTable = clsDatabase.Return_Datatable(sql, True)
|
||||
If USER_DT.Rows.Count = 0 Then
|
||||
ClassLogger.Add(" - User '" & USER_USERNAME & "' not listed in Useradministration!", False)
|
||||
LOGGER.Warn(" - User '" & USER_USERNAME & "' not listed in Useradministration!")
|
||||
'MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
'Me.Close()
|
||||
Dim msg = String.Format("You are not listed in the Useradministration." & vbNewLine & "Please contact the admin.")
|
||||
@@ -139,7 +139,7 @@ Public Class ClassUpdate
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in InitUser_Update_Spec: " & ex.Message, True)
|
||||
LOGGER.Warn("Unexpected Error in InitUser_Update_Spec: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
@@ -185,7 +185,7 @@ Public Class ClassUpdate
|
||||
'If FORCE_UPDATE = False Then
|
||||
|
||||
' If VERSIONS_FOR_FORCE_UPDATE.Contains(VERSION_USER) Then
|
||||
' ClassLogger.Add(String.Format("VersionChecker: ForceUpdate for User as Version '{0}' is used!", VERSION_USER), False)
|
||||
' Logger.Warn(String.Format("VersionChecker: ForceUpdate for User as Version '{0}' is used!", VERSION_USER), False)
|
||||
' ClassHelper.InsertEssential_Log(USER_GUID, "USER-ID", String.Format("VersionChecker: ForceUpdate for User as Version '{0}' is used!", VERSION_USER))
|
||||
' FORCE_UPDATE = True
|
||||
' End If
|
||||
@@ -195,7 +195,7 @@ Public Class ClassUpdate
|
||||
' If ALL_USERS = False Then
|
||||
' 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
|
||||
' ClassLogger.Add(String.Format("VersionChecker: User is not part of update-group - UPDATE-ID: {0}", UPDATE_ID), False)
|
||||
' Logger.Warn(String.Format("VersionChecker: User is not part of update-group - UPDATE-ID: {0}", UPDATE_ID), False)
|
||||
' ClassHelper.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
|
||||
@@ -220,7 +220,7 @@ Public Class ClassUpdate
|
||||
|
||||
Dim error_while_copying = False
|
||||
For Each Upd_item As DataRow In DT_UPDATE_ITEMS.Rows
|
||||
ClassLogger.Add(String.Format("...working on item {0}: ", Upd_item.Item("ITEM_INFO")), False)
|
||||
LOGGER.Info(String.Format("...working on item {0}: ", Upd_item.Item("ITEM_INFO")))
|
||||
|
||||
If Upd_item.Item("ITEM_INFO") = "VERSION_CHECKER.exe" Then
|
||||
KEEP_TEMPPATH = Upd_item.Item("BIT3")
|
||||
@@ -249,8 +249,8 @@ Public Class ClassUpdate
|
||||
End If
|
||||
End If
|
||||
targetfile = targetfile.ToString.Replace("//", "/")
|
||||
ClassLogger.Add(String.Format("...replacing targetfile '{0}': ", targetfile), False)
|
||||
Try
|
||||
LOGGER.Info(String.Format("...replacing targetfile '{0}': ", targetfile))
|
||||
Try
|
||||
' Replace the file.
|
||||
If File.Exists(targetfile) Then
|
||||
If File_Rename(targetfile, BackUpOfFileToReplace) = True Then
|
||||
@@ -258,7 +258,7 @@ Public Class ClassUpdate
|
||||
If KEEP_TEMPPATH Then
|
||||
If CopyFile(sourcefile, targetfile) = True Then
|
||||
File_Delete(BackUpOfFileToReplace)
|
||||
ClassLogger.Add(String.Format("...targetfile '{0}' was copied! ", targetfile), False)
|
||||
LOGGER.Warn(String.Format("...targetfile '{0}' was copied! ", targetfile), False)
|
||||
Dim updinfo
|
||||
If USER_INFO1 <> "" Then
|
||||
updinfo = USER_INFO1 & ";" & Upd_item.Item("INFO1") & "V" & Upd_item.Item("INFO2")
|
||||
@@ -271,7 +271,7 @@ Public Class ClassUpdate
|
||||
Else
|
||||
If MoveFile(sourcefile, targetfile) = True Then
|
||||
File_Delete(BackUpOfFileToReplace)
|
||||
ClassLogger.Add(String.Format("...targetfile '{0}' was replaced! ", targetfile), False)
|
||||
LOGGER.Info(String.Format("...targetfile '{0}' was replaced! ", targetfile))
|
||||
Dim updinfo
|
||||
If USER_INFO1 <> "" Then
|
||||
updinfo = USER_INFO1 & ";" & Upd_item.Item("INFO1") & "V" & Upd_item.Item("INFO2")
|
||||
@@ -281,7 +281,7 @@ Public Class ClassUpdate
|
||||
Dim _Sql = String.Format("Update TBDD_VERSION_USER_UPDATE_PATH SET INFO1 = '{2}' WHERE USER_ID = {0} AND UPPER(MODULE_NAME) = UPPER('{1}')", USER_GUID, "Record-Organizer", updinfo)
|
||||
clsDatabase.Execute_non_Query(_Sql)
|
||||
Else
|
||||
ClassLogger.Add(String.Format("MoveFile was not successfull! BackupFile will be activated!"))
|
||||
LOGGER.Warn(String.Format("MoveFile was not successfull! BackupFile will be activated!"))
|
||||
'Verschieben hat nicht geklappt also die Backupdatei wieder umbenennen!
|
||||
File_Rename(BackUpOfFileToReplace, targetfile)
|
||||
End If
|
||||
@@ -296,15 +296,15 @@ Public Class ClassUpdate
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("Error while copying file {0} to {1}: " & ex.Message, sourcefile, targetfile))
|
||||
error_while_replacing = True
|
||||
LOGGER.Warn(String.Format("Error while copying file {0} to {1}: " & ex.Message, sourcefile, targetfile))
|
||||
error_while_replacing = True
|
||||
UPDATE_ERROR = True
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("Unexpected Error in Replace_Files: {0}", ex.Message))
|
||||
LOGGER.Warn(String.Format("Unexpected Error in Replace_Files: {0}", ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
End Try
|
||||
End If
|
||||
@@ -318,20 +318,20 @@ Public Class ClassUpdate
|
||||
'Delete the tempfolder and all data
|
||||
System.IO.Directory.Delete(FOLDER_TEMP, True)
|
||||
Else
|
||||
ClassLogger.Add(String.Format("TEMP FOLDER SHALL BE KEPT..."), False)
|
||||
LOGGER.Info(String.Format("TEMP FOLDER SHALL BE KEPT..."), False)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
'Else
|
||||
' ClassLogger.Add(String.Format("The temporaryFolder could not be created!"))
|
||||
' Logger.Warn(String.Format("The temporaryFolder could not be created!"))
|
||||
'End If
|
||||
Else
|
||||
ClassLogger.Add(String.Format("The Updatepath '{0}'is not accessible or does not exist", MyServer_UpdatePath))
|
||||
LOGGER.Warn(String.Format("The Updatepath '{0}'is not accessible or does not exist", MyServer_UpdatePath))
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(String.Format("NO ACTION: the Updatepath is empty"))
|
||||
LOGGER.Warn(String.Format("NO ACTION: the Updatepath is empty"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -343,7 +343,7 @@ Public Class ClassUpdate
|
||||
End If
|
||||
FOLDER_TEMP = folder
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("Error while Creating tempfolder: " & ex.Message))
|
||||
LOGGER.Warn(String.Format("Error while Creating tempfolder: " & ex.Message))
|
||||
End Try
|
||||
|
||||
End Function
|
||||
@@ -359,7 +359,7 @@ Public Class ClassUpdate
|
||||
Rename(targetfile, Renamefilestring)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("ClassUpdate - Unexpected Error in File_Rename: " & "OldPath '{0}'" & "NewPath '{1}'" & "ERROR: {2}", targetfile, Renamefilestring, ex.Message))
|
||||
LOGGER.Warn(String.Format("ClassUpdate - Unexpected Error in File_Rename: " & "OldPath '{0}'" & "NewPath '{1}'" & "ERROR: {2}", targetfile, Renamefilestring, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
@@ -369,7 +369,7 @@ Public Class ClassUpdate
|
||||
File.Delete(deletefile)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("Unexpected Error in File_Delete: " & vbNewLine & "deletefile '{0}'" & vbNewLine & "ERROR: {2}", deletefile, ex.Message))
|
||||
LOGGER.Warn(String.Format("Unexpected Error in File_Delete: " & vbNewLine & "deletefile '{0}'" & vbNewLine & "ERROR: {2}", deletefile, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
@@ -379,7 +379,7 @@ Public Class ClassUpdate
|
||||
File.Move(sourcefile, targetfile)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("Unexpected Error in MoveFile: sourcefile '{0}', targetfile '{1}' - ERROR: {2}", sourcefile, targetfile, ex.Message))
|
||||
LOGGER.Warn(String.Format("Unexpected Error in MoveFile: sourcefile '{0}', targetfile '{1}' - ERROR: {2}", sourcefile, targetfile, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
@@ -389,7 +389,7 @@ Public Class ClassUpdate
|
||||
File.Copy(sourcefile, destfile, True)
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(String.Format("Unexpected Error in CopyFile: sourcefile '{0}', destfile '{1}' - ERROR: {2}", sourcefile, destfile, ex.Message))
|
||||
LOGGER.Warn(String.Format("Unexpected Error in CopyFile: sourcefile '{0}', destfile '{1}' - ERROR: {2}", sourcefile, destfile, ex.Message))
|
||||
UPDATE_ERROR = True
|
||||
Return False
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user