@@ -36,7 +36,6 @@ public partial class MainForm : Form, IMessageFilter
36
36
private LocaleData localeData ;
37
37
private Boolean localeOverride ;
38
38
private String [ ] notifyPaths ;
39
- private Boolean shouldNotify ;
40
39
private Boolean haveUpdates ;
41
40
private Boolean checkOnly ;
42
41
@@ -65,7 +64,6 @@ public MainForm(String[] args)
65
64
this . CheckArgs ( args ) ;
66
65
this . isLoading = false ;
67
66
this . haveUpdates = false ;
68
- this . shouldNotify = false ;
69
67
this . InitializeSettings ( ) ;
70
68
this . InitializeLocalization ( ) ;
71
69
this . InitializeComponent ( ) ;
@@ -351,11 +349,11 @@ private void MainFormHelpButtonClicked(Object sender, CancelEventArgs e)
351
349
/// <summary>
352
350
/// Save notification files to the notify paths.
353
351
/// </summary>
354
- private void MainFormClosed ( Object sender , FormClosedEventArgs e )
352
+ private void NotifyPaths ( )
355
353
{
356
354
try
357
355
{
358
- if ( ! this . shouldNotify || this . notifyPaths == null ) return ;
356
+ if ( this . notifyPaths == null ) return ;
359
357
foreach ( String nPath in this . notifyPaths )
360
358
{
361
359
try
@@ -442,7 +440,6 @@ private void DeleteButtonClick(Object sender, EventArgs e)
442
440
{
443
441
try
444
442
{
445
- this . shouldNotify = true ;
446
443
String title = this . localeData . ConfirmTitle ;
447
444
String message = this . localeData . DeleteSelectedConfirm ;
448
445
if ( MessageBox . Show ( message , title , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) == DialogResult . Yes )
@@ -469,6 +466,7 @@ private void DeleteButtonClick(Object sender, EventArgs e)
469
466
this . TryDeleteEntryDir ( entry ) ;
470
467
}
471
468
}
469
+ this . NotifyPaths ( ) ;
472
470
}
473
471
}
474
472
catch ( Exception ex )
@@ -938,9 +936,12 @@ private void RunExecutableProcess(String file)
938
936
if ( file . ToLower ( ) . EndsWith ( ".fdz" ) )
939
937
{
940
938
String fd = Path . Combine ( PathHelper . GetExeDirectory ( ) , @"..\..\FlashDevelop.exe" ) ;
939
+ Boolean wait = Process . GetProcessesByName ( "FlashDevelop" ) . Length == 0 ;
941
940
if ( File . Exists ( fd ) )
942
941
{
943
942
Process . Start ( Path . GetFullPath ( fd ) , file + " -silent -reuse" ) ;
943
+ // If FD was not running, give it a little time to start...
944
+ if ( wait ) Thread . Sleep ( 500 ) ;
944
945
return ;
945
946
}
946
947
}
@@ -1336,8 +1337,8 @@ private void WorkerDoCompleted(Object sender, RunWorkerCompletedEventArgs e)
1336
1337
#endif
1337
1338
Thread . Sleep ( 100 ) ; // Wait for files...
1338
1339
this . LoadInstalledEntries ( ) ;
1339
- this . shouldNotify = true ;
1340
1340
this . UpdateEntryStates ( ) ;
1341
+ this . NotifyPaths ( ) ;
1341
1342
}
1342
1343
else this . RunExecutableProcess ( this . tempFile ) ;
1343
1344
if ( this . downloadQueue . Count > 0 ) this . DownloadNextFromQueue ( ) ;
0 commit comments