Autmatically move to Roaming profile

This commit is contained in:
Andreas Rehm
2011-04-30 19:33:45 +02:00
parent 605cb4048b
commit 3592fbc418
2 changed files with 18 additions and 1 deletions

View File

@@ -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))

View File

@@ -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: