fix
This commit is contained in:
parent
278dda42a8
commit
2153e83426
@ -1,4 +1,5 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports System.Windows.Forms
|
||||||
Imports DigitalData.Modules.Base
|
Imports DigitalData.Modules.Base
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
@ -13,6 +14,28 @@ Public Class ConfigUtils
|
|||||||
_File = New FilesystemEx(LogConfig)
|
_File = New FilesystemEx(LogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Migrate a config file when the ProductName has changed
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="pUserBasePath">The user config base path, should be Application.UserAppDataPath</param>
|
||||||
|
''' <param name="pProductName">The current or new product name</param>
|
||||||
|
''' <param name="pOldProductName">The old product name</param>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Function MigrateUserAppDataConfig(pUserBasePath As String, pProductName As String, pOldProductName As String)
|
||||||
|
Return MigrateAppDataConfig(pUserBasePath, ConfigManager(Of ConfigSample).USER_CONFIG_NAME, pProductName, pOldProductName)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Migrate a config file when the ProductName has changed
|
||||||
|
''' </summary>
|
||||||
|
''' <param name="pCommonBasePath">The config base path, should be Application.CommonAppDataPath</param>
|
||||||
|
''' <param name="pProductName">The current or new product name</param>
|
||||||
|
''' <param name="pOldProductName">The old product name</param>
|
||||||
|
''' <returns></returns>
|
||||||
|
Public Function MigrateCommonAppDataConfig(pCommonBasePath As String, pProductName As String, pOldProductName As String)
|
||||||
|
Return MigrateAppDataConfig(pCommonBasePath, ConfigManager(Of ConfigSample).COMPUTER_CONFIG_NAME, pProductName, pOldProductName)
|
||||||
|
End Function
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Migrate a config file when the ProductName has changed
|
''' Migrate a config file when the ProductName has changed
|
||||||
''' </summary>
|
''' </summary>
|
||||||
@ -20,7 +43,7 @@ Public Class ConfigUtils
|
|||||||
''' <param name="pProductName">The current or new product name</param>
|
''' <param name="pProductName">The current or new product name</param>
|
||||||
''' <param name="pOldProductName">The old product name</param>
|
''' <param name="pOldProductName">The old product name</param>
|
||||||
''' <returns></returns>
|
''' <returns></returns>
|
||||||
Public Function MigrateAppDataConfig(pBasePath As String, pConfigName As String, pProductName As String, pOldProductName As String)
|
Private Function MigrateAppDataConfig(pBasePath As String, pConfigName As String, pProductName As String, pOldProductName As String)
|
||||||
Dim oNewDirPath = pBasePath
|
Dim oNewDirPath = pBasePath
|
||||||
Dim oOldDirPath = oNewDirPath.Replace(pProductName, pOldProductName)
|
Dim oOldDirPath = oNewDirPath.Replace(pProductName, pOldProductName)
|
||||||
Dim oNewFilePath = Path.Combine(oNewDirPath, pConfigName)
|
Dim oNewFilePath = Path.Combine(oNewDirPath, pConfigName)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user