Skip to content

Commit ed5a846

Browse files
committed
Merge branch 'master' up to commit 657d342
2 parents 9c65b84 + 657d342 commit ed5a846

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

Wox.Core/Configuration/Portable.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,27 @@ public void PreStartCleanUpAfterPortabilityUpdate()
161161

162162
if (DataLocationRoamingDeleteRequired)
163163
{
164-
if(roamingDataPath.LocationExists())
165-
MessageBox.Show("Wox detected you restarted after enabling portable mode, " +
166-
"your roaming data profile will now be deleted");
167-
168164
FilesFolders.RemoveFolderIfExists(roamingDataPath);
169165

166+
if (MessageBox.Show("Wox has detected you enabled portable mode, " +
167+
"would you like to move it to a different location?", string.Empty,
168+
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
169+
{
170+
FilesFolders.OpenLocationInExporer(Constant.RootDirectory);
171+
172+
Environment.Exit(0);
173+
}
174+
170175
return;
171176
}
172177

173178
if(DataLocationPortableDeleteRequired)
174179
{
175-
MessageBox.Show("Wox detected you restarted after disabling portable mode, " +
176-
"your portable data profile will now be deleted");
177-
178180
FilesFolders.RemoveFolderIfExists(portableDataPath);
179181

182+
MessageBox.Show("Wox has detected you disabled portable mode, " +
183+
"the relevant shortcuts and uninstaller entry have been created");
184+
180185
return;
181186
}
182187
}

Wox.Plugin/SharedCommands/FilesFolders.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.IO;
34
using System.Windows;
45

@@ -107,5 +108,22 @@ public static bool FileExits(this string filePath)
107108
{
108109
return File.Exists(filePath);
109110
}
111+
112+
public static void OpenLocationInExporer(string location)
113+
{
114+
try
115+
{
116+
if (LocationExists(location))
117+
Process.Start(location);
118+
}
119+
catch (Exception e)
120+
{
121+
#if DEBUG
122+
throw e;
123+
#else
124+
MessageBox.Show(string.Format("Unable to open location {0}, please check if it exists", location));
125+
#endif
126+
}
127+
}
110128
}
111129
}

0 commit comments

Comments
 (0)