File tree Expand file tree Collapse file tree 2 files changed +30
-7
lines changed
Wox.Plugin/SharedCommands Expand file tree Collapse file tree 2 files changed +30
-7
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 11using System ;
2+ using System . Diagnostics ;
23using System . IO ;
34using 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}
You can’t perform that action at this time.
0 commit comments