mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
fixed #1470: Use local app data folder for personal path config file
This commit is contained in:
parent
afc7448109
commit
bdc8331e5a
1 changed files with 13 additions and 4 deletions
|
@ -104,16 +104,25 @@ public static string TitleLong
|
||||||
|
|
||||||
#region Paths
|
#region Paths
|
||||||
|
|
||||||
public static readonly string DefaultPersonalFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ShareX");
|
private const string AppName = "ShareX";
|
||||||
private static readonly string PortablePersonalFolder = Helpers.GetAbsolutePath("ShareX");
|
private const string PersonalPathConfigFileName = "PersonalPath.cfg";
|
||||||
|
|
||||||
|
public static readonly string DefaultPersonalFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), AppName);
|
||||||
|
private static readonly string PortablePersonalFolder = Helpers.GetAbsolutePath(AppName);
|
||||||
private static readonly string PortableAppsPersonalFolder = Helpers.GetAbsolutePath("../../Data");
|
private static readonly string PortableAppsPersonalFolder = Helpers.GetAbsolutePath("../../Data");
|
||||||
|
|
||||||
private static string PersonalPathConfigFilePath
|
private static string PersonalPathConfigFilePath
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
string oldPath = Helpers.GetAbsolutePath("PersonalPath.cfg");
|
string oldPath = Helpers.GetAbsolutePath(PersonalPathConfigFileName);
|
||||||
return File.Exists(oldPath) ? oldPath : Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"ShareX\PersonalPath.cfg");
|
|
||||||
|
if (IsPortable || IsPortableApps || File.Exists(oldPath))
|
||||||
|
{
|
||||||
|
return oldPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), AppName, PersonalPathConfigFileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue