Simply use the FormClosing event like you normally would:
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("Are you sure you want to close?", "Closing...", MessageBoxButtons.YesNo) == DialogResult.No) e.Cancel = true; }
The update install command is sent to wyUpdate only after FormClosing has passed.