Adjustments to zdict transfer
This commit is contained in:
parent
86e63a65cd
commit
6470c6ef34
@ -86,21 +86,26 @@ namespace Toolbox.Library
|
|||||||
if (!Directory.Exists(userDir))
|
if (!Directory.Exists(userDir))
|
||||||
Directory.CreateDirectory(userDir);
|
Directory.CreateDirectory(userDir);
|
||||||
|
|
||||||
|
//Create folder for TOTK contents if it does not exist
|
||||||
|
if (!Directory.Exists(Path.Combine(userDir, "TOTK")))
|
||||||
|
Directory.CreateDirectory(Path.Combine(userDir, "TOTK"));
|
||||||
|
|
||||||
string folder = Path.Combine(userDir, "TOTK", "ZstdDictionaries");
|
string folder = Path.Combine(userDir, "TOTK", "ZstdDictionaries");
|
||||||
|
|
||||||
//Check if old directory exists and move it
|
|
||||||
string folderOld = Path.Combine(Runtime.ExecutableDir, "Lib", "ZstdDictionaries");
|
void TransferZDic(string path)
|
||||||
if (Directory.Exists(folderOld))
|
|
||||||
{
|
{
|
||||||
//Create folder for TOTK contents if it does not exist
|
//Check if old directory contains the file and move it
|
||||||
if (!Directory.Exists(Path.Combine(userDir, "TOTK")))
|
string fileOld = Path.Combine(Runtime.ExecutableDir, "Lib", "ZstdDictionaries", path);
|
||||||
Directory.CreateDirectory(Path.Combine(userDir, "TOTK"));
|
string fileNew = Path.Combine(folder, path);
|
||||||
//Remove previous folder with any old files incase it gets updated with additional content
|
if (!File.Exists(fileNew) && File.Exists(fileOld))
|
||||||
if (Directory.Exists(folder))
|
{
|
||||||
Directory.Delete(folder, true);
|
File.Move(fileOld, fileNew);
|
||||||
//Move old to new directory
|
}
|
||||||
Directory.Move(folderOld, folder);
|
|
||||||
}
|
}
|
||||||
|
TransferZDic("bcett.byml.zsdic");
|
||||||
|
TransferZDic("pack.zsdic");
|
||||||
|
TransferZDic("zs.zsdic");
|
||||||
|
|
||||||
if (Directory.Exists(folder))
|
if (Directory.Exists(folder))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user