From 3592fbc418495a42d197201d8ab7e3ebeeb0ed9f Mon Sep 17 00:00:00 2001 From: Andreas Rehm Date: Sat, 30 Apr 2011 19:33:45 +0200 Subject: [PATCH] Autmatically move to Roaming profile --- mRemoteV1/App/App.Runtime.vb | 17 +++++++++++++++++ mRemoteV1/Notes/Misc.txt | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mRemoteV1/App/App.Runtime.vb b/mRemoteV1/App/App.Runtime.vb index 7c6aaad6..500b20ae 100644 --- a/mRemoteV1/App/App.Runtime.vb +++ b/mRemoteV1/App/App.Runtime.vb @@ -4,6 +4,7 @@ Imports Crownwood Imports System.Threading Imports System.Xml Imports mRemoteNG.App.Native +Imports System.Environment Namespace App Public Class Runtime @@ -783,6 +784,22 @@ Namespace App End If End If + ' LocalApplicationData to ApplicationData move if needed + Dim oldPath As String = GetFolderPath(SpecialFolder.LocalApplicationData) & "\" & My.Application.Info.ProductName + Dim newPath As String = App.Info.Connections.DefaultConnectionsPath + Dim dirinfonew As IO.DirectoryInfo + dirinfonew = New IO.DirectoryInfo(newPath) + If (Not dirinfonew.Exists) Then + Dim dirinfoold As IO.DirectoryInfo + dirinfoold = New IO.DirectoryInfo(oldPath) + If (dirinfoold.Exists) Then + MkDir(dirinfonew.FullName) + For Each fileInfo As FileInfo In dirinfoold.GetFiles + File.Move(fileInfo.FullName, Path.Combine(newPath, fileInfo.Name)) + Next + End If + End If + If File.Exists(conL.ConnectionFileName) = False Then If WithDialog Then mC.AddMessage(Messages.MessageClass.WarningMsg, String.Format(My.Resources.strConnectionsFileCouldNotBeLoaded, conL.ConnectionFileName)) diff --git a/mRemoteV1/Notes/Misc.txt b/mRemoteV1/Notes/Misc.txt index 047b8840..fb25d9a6 100644 --- a/mRemoteV1/Notes/Misc.txt +++ b/mRemoteV1/Notes/Misc.txt @@ -4,7 +4,7 @@ How to build the portable package: to Inherits PortableSettingsProvider In App.Info.Settings: change SettingsPath - from GetFolderPath(SpecialFolder.LocalApplicationData) & "\" & My.Application.Info.CompanyName.Replace(" ", "_") & "\" & My.Application.Info.ProductName + from GetFolderPath(SpecialFolder.ApplicationData) & "\" & My.Application.Info.CompanyName.Replace(" ", "_") & "\" & My.Application.Info.ProductName to My.Application.Info.DirectoryPath How to add a new language: