(Improvement) Writes config files into individual setting folder when in portable mode
When mRemoteNG is in portable mode, app should writes config files (.xml) and backup files (.backup) into individual setting folder, not into root directory where exe file exist.
Expected Behavior
When mRemoteNG is in portable mode, new version should writes config files (.xml) and backup files (.backup) into individual setting folder.
Current Behavior
When mRemoteNG is in portable mode, current version writes config files (.xml) and backup files (.backup) into root directory where exe file exist.
Possible Solution
mRemoteNG/App/Info/SettingsFileInfo.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mRemoteNG/App/Info/SettingsFileInfo.cs b/mRemoteNG/App/Info/SettingsFileInfo.cs
index 1f0a2404..abb3faf4 100644
--- a/mRemoteNG/App/Info/SettingsFileInfo.cs
+++ b/mRemoteNG/App/Info/SettingsFileInfo.cs
@@ -12,7 +12,7 @@ namespace mRemoteNG.App.Info
{
private static readonly string ExePath = Path.GetDirectoryName(Assembly.GetAssembly(typeof(ConnectionInfo))?.Location);
- public static string SettingsPath => Runtime.IsPortableEdition ? ExePath : Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + Application.ProductName;
+ public static string SettingsPath => Runtime.IsPortableEdition ? ( ExePath + "\\" + "PortableEditionSettings") : (Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + Application.ProductName);
public static string LayoutFileName { get; } = "pnlLayout.xml";
public static string ExtAppsFilesName { get; } = "extApps.xml";
Steps to Reproduce (for bugs)
(Not a bug)
Context
After this change, move and backup setting files (.xml and .backup) will be easier.
Your Environment
- Version used: v1.77.3-dev
- Operating System and version: Windows 11
One more thing.
Should another config file user.config (located in C:\Users\[username]\AppData\Local\mRemoteNG\mRemoteNG_Url_[id]\[version]) writes into such new individual setting folder when in portable mode? But it will break per-user setting behavior, and change this behavior seems not easy. I'm not familier with .net
in new version configuration bits are kept in same folder where mR is installed and perhaps will turn in to fully portable mode, so no files are creating outside of installation folder.