diff --git a/Config/ConfigUtils.vb b/Config/ConfigUtils.vb index e9fce55a..7bf25391 100644 --- a/Config/ConfigUtils.vb +++ b/Config/ConfigUtils.vb @@ -23,8 +23,15 @@ Public Class ConfigUtils End If End Function - Public Function MigrateAppDataConfig(pUserAppDataPath As String, pProductName As String, pOldProductName As String) - Dim oNewDirPath = pUserAppDataPath + ''' + ''' Migrate a config file when the ProductName has changed + ''' + ''' The config base path, can be Application.UserAppDataPath or Application.CommonAppDataPath + ''' The current or new product name + ''' The old product name + ''' + Public Function MigrateAppDataConfig(pBasePath As String, pProductName As String, pOldProductName As String) + Dim oNewDirPath = pBasePath Dim oOldDirPath = oNewDirPath.Replace(pProductName, pOldProductName) Dim oNewFilePath = Path.Combine(oNewDirPath, USER_CONFIG) Dim oOldFilePath = Path.Combine(oOldDirPath, USER_CONFIG) @@ -45,7 +52,7 @@ Public Class ConfigUtils End If _Logger.Info("Migrating Config from [{0}] to [{1}]", pOldProductName, pProductName) - File.Copy(oOldFilePath, oNewFilePath) + File.Move(oOldFilePath, oNewFilePath) Return True Catch ex As Exception