fix appdata path and log path

This commit is contained in:
Jonathan Jenne 2019-06-17 10:45:09 +02:00
parent d3b5955b45
commit 0878c02ace
2 changed files with 7 additions and 5 deletions

View File

@ -13,18 +13,19 @@ Namespace My
Private _Logger As Logger
Private _BaseUserConfigPath As String = Windows.Forms.Application.UserAppDataPath
Private _BaseLocalUserConfigPath As String = Windows.Forms.Application.LocalUserAppDataPath
Private _BaseMachineConfigPath As String = Windows.Forms.Application.CommonAppDataPath
Public Sub App_Startup() Handles Me.Startup
Dim oLogConfig As New LogConfig(PathType.AppData)
Dim oLogConfig As New LogConfig(PathType.CustomPath, IO.Path.Combine(_BaseLocalUserConfigPath, "Log"))
' System Config files like Service Url will be saved in %LocalAppdata% so they will remain on the machine
Dim oSystemConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig,
Windows.Forms.Application.UserAppDataPath,
Windows.Forms.Application.CommonAppDataPath)
_BaseLocalUserConfigPath,
_BaseMachineConfigPath)
' Layout files will be saved in %Appdata% (Roaming) so they will be syncronized with the user profile
Dim oUIConfigPath = IO.Path.Combine(Windows.Forms.Application.UserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
Dim oUIConfigPath = IO.Path.Combine(_BaseUserConfigPath, ClassConstants.FOLDER_NAME_LAYOUT)
Dim oUIConfigManager As New ConfigManager(Of ClassUIConfig)(oLogConfig, oUIConfigPath, oUIConfigPath)
LogConfig = oLogConfig

View File

@ -22,7 +22,8 @@ Public Class frmConfigUser
End Sub
Private Sub btnAppFolder_Click(sender As Object, e As EventArgs) Handles btnAppFolder.Click
Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
Dim oAppData = Application.LocalUserAppDataPath
Process.Start(oAppData)
End Sub
Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged