Merge branch 'dev'

This commit is contained in:
Jeremy Wu 2020-04-11 10:10:49 +10:00
commit 657d342c51
2 changed files with 30 additions and 7 deletions

View file

@ -163,22 +163,27 @@ namespace Wox.Core.Configuration
if (DataLocationRoamingDeleteRequired)
{
if(roamingDataPath.LocationExists())
MessageBox.Show("Wox detected you restarted after enabling portable mode, " +
"your roaming data profile will now be deleted");
FilesFolders.RemoveFolderIfExists(roamingDataPath);
if (MessageBox.Show("Wox has detected you enabled portable mode, " +
"would you like to move it to a different location?", string.Empty,
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
FilesFolders.OpenLocationInExporer(Constant.RootDirectory);
Environment.Exit(0);
}
return;
}
if(DataLocationPortableDeleteRequired)
{
MessageBox.Show("Wox detected you restarted after disabling portable mode, " +
"your portable data profile will now be deleted");
FilesFolders.RemoveFolderIfExists(portableDataPath);
MessageBox.Show("Wox has detected you disabled portable mode, " +
"the relevant shortcuts and uninstaller entry have been created");
return;
}
}

View file

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Windows;
@ -107,5 +108,22 @@ namespace Wox.Plugin.SharedCommands
{
return File.Exists(filePath);
}
public static void OpenLocationInExporer(string location)
{
try
{
if (LocationExists(location))
Process.Start(location);
}
catch (Exception e)
{
#if DEBUG
throw e;
#else
MessageBox.Show(string.Format("Unable to open location {0}, please check if it exists", location));
#endif
}
}
}
}