Skip to content

Commit 657d342

Browse files
committed
Merge branch 'dev'
2 parents f325674 + 9937dbb commit 657d342

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
@@ -163,22 +163,27 @@ public void PreStartCleanUpAfterPortabilityUpdate()
163163

164164
if (DataLocationRoamingDeleteRequired)
165165
{
166-
if(roamingDataPath.LocationExists())
167-
MessageBox.Show("Wox detected you restarted after enabling portable mode, " +
168-
"your roaming data profile will now be deleted");
169-
170166
FilesFolders.RemoveFolderIfExists(roamingDataPath);
171167

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

175180
if(DataLocationPortableDeleteRequired)
176181
{
177-
MessageBox.Show("Wox detected you restarted after disabling portable mode, " +
178-
"your portable data profile will now be deleted");
179-
180182
FilesFolders.RemoveFolderIfExists(portableDataPath);
181183

184+
MessageBox.Show("Wox has detected you disabled portable mode, " +
185+
"the relevant shortcuts and uninstaller entry have been created");
186+
182187
return;
183188
}
184189
}

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)