need code for custom update checking...
I need the code for custom update checking using ClickOnce System.Deployment APIs...
(ie) the user should be prompted to choose the update to happen after one day or one week....
thanks....
thanks....
private void OnCheckForUpdates(object sender, EventArgs e)
{
// Always confirm we are running through ClickOnce
if (ApplicationDeployment.IsNetworkDeployed)
{
// Hold a reference to the current deployment
ApplicationDeployment current =
ApplicationDeployment.CurrentDeployment;
// Check to see if an update is available on the server
if (current.CheckForUpdate())
{
// One is available, go get it
current.Update();
DialogResult dr = MessageBox.Show(
"Update downloaded, restart application?",
"Application Update",MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
Application.Restart();
}
}
}
}