mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Better custom personal path handling
This commit is contained in:
parent
2ae48395f6
commit
16537683e5
2 changed files with 14 additions and 9 deletions
|
@ -95,7 +95,7 @@ public static string PersonalPath
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(CustomPersonalPath) && Directory.Exists(CustomPersonalPath))
|
if (!string.IsNullOrEmpty(CustomPersonalPath))
|
||||||
{
|
{
|
||||||
return CustomPersonalPath;
|
return CustomPersonalPath;
|
||||||
}
|
}
|
||||||
|
@ -272,6 +272,9 @@ private static void Main(string[] args)
|
||||||
|
|
||||||
private static void Run()
|
private static void Run()
|
||||||
{
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
IsSilentRun = CLIHelper.CheckArgs(Arguments, "silent", "s");
|
IsSilentRun = CLIHelper.CheckArgs(Arguments, "silent", "s");
|
||||||
IsSandbox = CLIHelper.CheckArgs(Arguments, "sandbox");
|
IsSandbox = CLIHelper.CheckArgs(Arguments, "sandbox");
|
||||||
|
|
||||||
|
@ -288,14 +291,19 @@ private static void Run()
|
||||||
CheckPersonalPathConfig();
|
CheckPersonalPathConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(PersonalPath) && !Directory.Exists(PersonalPath))
|
if (!Directory.Exists(PersonalPath))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(PersonalPath);
|
Directory.CreateDirectory(PersonalPath);
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Unable to create folder: \"" + PersonalPath + "\"\r\n\r\n" + e.ToString(), "ShareX - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
CustomPersonalPath = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
|
||||||
|
|
||||||
DebugHelper.WriteLine("{0} started", Title);
|
DebugHelper.WriteLine("{0} started", Title);
|
||||||
DebugHelper.WriteLine("Operating system: " + Environment.OSVersion.VersionString);
|
DebugHelper.WriteLine("Operating system: " + Environment.OSVersion.VersionString);
|
||||||
|
|
|
@ -76,9 +76,6 @@ private static void Main(string[] args)
|
||||||
File.WriteAllText(Path.Combine(portableDir, "PersonalPath.cfg"), "ShareX", Encoding.UTF8);
|
File.WriteAllText(Path.Combine(portableDir, "PersonalPath.cfg"), "ShareX", Encoding.UTF8);
|
||||||
Console.WriteLine("Created PersonalPath.cfg file.");
|
Console.WriteLine("Created PersonalPath.cfg file.");
|
||||||
|
|
||||||
Directory.CreateDirectory(Path.Combine(portableDir, "ShareX"));
|
|
||||||
Console.WriteLine("Created ShareX folder.");
|
|
||||||
|
|
||||||
//FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Path.Combine(releaseDir, "ShareX.exe"));
|
//FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Path.Combine(releaseDir, "ShareX.exe"));
|
||||||
//string zipFilename = string.Format("ShareX-{0}.{1}.{2}-portable.zip", versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart);
|
//string zipFilename = string.Format("ShareX-{0}.{1}.{2}-portable.zip", versionInfo.ProductMajorPart, versionInfo.ProductMinorPart, versionInfo.ProductBuildPart);
|
||||||
string zipPath = Path.Combine(outputDir, "ShareX-portable.zip");
|
string zipPath = Path.Combine(outputDir, "ShareX-portable.zip");
|
||||||
|
|
Loading…
Reference in a new issue