void InstallPendingUpdate()
{
BeforeArgs bArgs = new BeforeArgs();
if (BeforeInstalling != null)
BeforeInstalling(this, bArgs);
// if the update is cancelled postpone the update until later
if (bArgs.Cancel)
{
if (ClosingForInstall && ClosingAborted != null)
{
ClosingAborted(this, EventArgs.Empty);
ClosingForInstall = false;
}
return;
}
// send the client the arguments that need to run on success and failure
if (ServiceName != null)
updateHelper.RestartInfo(ServiceName, AutoUpdaterInfo.AutoUpdateID, Arguments, true);
else
updateHelper.RestartInfo(Application.ExecutablePath, AutoUpdaterInfo.AutoUpdateID, Arguments, false);
}