@@ -321,53 +321,54 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
321
321
322
322
if ( MessageBox . Show ( message ,
323
323
Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
324
- MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
324
+ MessageBoxButton . YesNo ) == MessageBoxResult . No )
325
325
{
326
- Parallel . ForEach ( resultsForUpdate , plugin =>
327
- {
328
- var downloadToFilePath = Path . Combine ( Path . GetTempPath ( ) , $ "{ plugin . Name } -{ plugin . NewVersion } .zip") ;
326
+ return false ;
327
+ }
329
328
330
- _ = Task . Run ( async delegate
331
- {
332
- if ( File . Exists ( downloadToFilePath ) )
333
- {
334
- File . Delete ( downloadToFilePath ) ;
335
- }
329
+ Parallel . ForEach ( resultsForUpdate , plugin =>
330
+ {
331
+ var downloadToFilePath = Path . Combine ( Path . GetTempPath ( ) , $ "{ plugin . Name } -{ plugin . NewVersion } .zip") ;
336
332
337
- await Http . DownloadAsync ( plugin . PluginNewUserPlugin . UrlDownload , downloadToFilePath )
338
- . ConfigureAwait ( false ) ;
333
+ _ = Task . Run ( async delegate
334
+ {
335
+ if ( File . Exists ( downloadToFilePath ) )
336
+ {
337
+ File . Delete ( downloadToFilePath ) ;
338
+ }
339
339
340
- PluginManager . UpdatePlugin ( plugin . PluginExistingMetadata , plugin . PluginNewUserPlugin , downloadToFilePath ) ;
340
+ await Http . DownloadAsync ( plugin . PluginNewUserPlugin . UrlDownload , downloadToFilePath )
341
+ . ConfigureAwait ( false ) ;
341
342
342
- } ) . ContinueWith ( t =>
343
- {
344
- Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ",
345
- t . Exception . InnerException ) ;
346
- Context . API . ShowMsg (
347
- Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
348
- string . Format (
349
- Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
350
- plugin . Name ) ) ;
351
- } , TaskContinuationOptions . OnlyOnFaulted ) ;
352
- } ) ;
343
+ PluginManager . UpdatePlugin ( plugin . PluginExistingMetadata , plugin . PluginNewUserPlugin , downloadToFilePath ) ;
353
344
354
- if ( Settings . AutoRestartAfterChanging )
355
- {
356
- Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
357
- string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_success_restart" ) ,
358
- resultsForUpdate . Count ( ) ) ) ;
359
- Context . API . RestartApp ( ) ;
360
- }
361
- else
345
+ } ) . ContinueWith ( t =>
362
346
{
363
- Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
364
- string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_success_no_restart" ) ,
365
- resultsForUpdate . Count ( ) ) ) ;
366
- }
347
+ Log . Exception ( "PluginsManager" , $ "Update failed for { plugin . Name } ",
348
+ t . Exception . InnerException ) ;
349
+ Context . API . ShowMsg (
350
+ Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_title" ) ,
351
+ string . Format (
352
+ Context . API . GetTranslation ( "plugin_pluginsmanager_install_error_subtitle" ) ,
353
+ plugin . Name ) ) ;
354
+ } , TaskContinuationOptions . OnlyOnFaulted ) ;
355
+ } ) ;
367
356
368
- return true ;
357
+ if ( Settings . AutoRestartAfterChanging )
358
+ {
359
+ Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
360
+ string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_success_restart" ) ,
361
+ resultsForUpdate . Count ( ) ) ) ;
362
+ Context . API . RestartApp ( ) ;
369
363
}
370
- return false ;
364
+ else
365
+ {
366
+ Context . API . ShowMsg ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_title" ) ,
367
+ string . Format ( Context . API . GetTranslation ( "plugin_pluginsmanager_update_all_success_no_restart" ) ,
368
+ resultsForUpdate . Count ( ) ) ) ;
369
+ }
370
+
371
+ return true ;
371
372
} ,
372
373
ContextData = new UserPlugin ( )
373
374
} ;
0 commit comments