mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
Autmatically move to Roaming profile
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user