Ok folks, I got it. A background worker did the trick, but it took some Googling to actually get it working. Here's what I did:
namespace MyNameSpace
{
public partial class Form1 : Form
{
BackgroundWorker bw = new BackgroundWorker();
public Form1()
{
InitializeComponent();
this.Show();
bw.WorkerSupportsCancellation = false;
bw.WorkerReportsProgress = false;
}
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
}
private void Form1_Shown(Object sender, EventArgs e)
{
this.bw.DoWork += bw_DoWork;
this.bw.RunWorkerCompleted += bw_RunWorkerCompleted;
bw.RunWorkerAsync();
}
private void bw_RunWorkerCompleted(object sender, _
RunWorkerCompletedEventArgs e)
{
if (File.Exists(successIndicatorFile))
success();
else
failure();
}
Thanks to everyone who advised me.