Bug 249219. On windows, migrate .miCASA files to [homedir]\CASA.
This commit is contained in:
parent
a37d1294aa
commit
041353b40f
@ -491,7 +491,7 @@ public class Common
|
||||
if (Common.IS_LINUX)
|
||||
return (config.GetConfigSetting(CONFIG_PERSISTENT_DIRECTORY, "/home/.casa/" + GetUserName()));
|
||||
else
|
||||
return (config.GetConfigSetting(CONFIG_PERSISTENT_DIRECTORY, GetUserHomeDir()));
|
||||
return (config.GetConfigSetting(CONFIG_PERSISTENT_DIRECTORY, GetUserHomeDir() + "\\CASA"));
|
||||
}
|
||||
|
||||
internal static void SetUserPersistentDir(Config config, string sNewDirectory)
|
||||
|
25
CASA/micasad/cache/SecretStore.cs
vendored
25
CASA/micasad/cache/SecretStore.cs
vendored
@ -931,21 +931,28 @@ namespace sscs.cache
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if LINUX
|
||||
|
||||
m_persistenceDirectory = MigrateMiCasaFiles();
|
||||
return m_persistenceDirectory;
|
||||
#else
|
||||
return GetUserHomeDirectory();
|
||||
#endif
|
||||
}
|
||||
|
||||
internal string MigrateMiCasaFiles()
|
||||
{
|
||||
{
|
||||
string sSeperator = "/";
|
||||
#if LINUX
|
||||
// for v1.7, we are storing MiCasa files in /home/.casa/[username]
|
||||
// let's migrate the files if needed
|
||||
string sNewPath = POLICY_DIRECTORY + "/" + user.GetUserName();
|
||||
|
||||
string sNewPath = POLICY_DIRECTORY + "/" + user.GetUserName();
|
||||
#else
|
||||
string sNewPath = GetUserHomeDirectory() + "\\CASA";
|
||||
|
||||
if (!Directory.Exists(sNewPath))
|
||||
{
|
||||
Directory.CreateDirectory(sNewPath);
|
||||
}
|
||||
|
||||
sSeperator = "\\";
|
||||
#endif
|
||||
try
|
||||
{
|
||||
if (Directory.GetFiles(sNewPath, ".miCASA*").Length > 0)
|
||||
@ -958,7 +965,7 @@ namespace sscs.cache
|
||||
{
|
||||
for (int i = 0; i < miCASAFiles.Length; i++)
|
||||
{
|
||||
string sFileName = miCASAFiles[i].Substring(miCASAFiles[i].LastIndexOf("/"));
|
||||
string sFileName = miCASAFiles[i].Substring(miCASAFiles[i].LastIndexOf(sSeperator));
|
||||
File.Move(miCASAFiles[i], sNewPath + sFileName);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user