Hi, Razer1911,
You can use clickonce to deploy your application and it updatesautomatically.
ClickOnce tutorial
http://msdn2.microsoft.com/en-us/library/t71a733d(VS.80).aspx
If you want to update manually,
thenyou don't need to choose "The application should check for updates",
just use some logic to trigger the update.
For example
Code Snippet
private void saveButton_Click(object sender, EventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed == true)
{
ApplicationDeployment thisDeployment = ApplicationDeployment.CurrentDeployment;
this.Text = "Checking update!";
if (thisDeployment.CheckForUpdate() == true)
{
if (MessageBox.Show("New Version detected, update now?", "Update Now?", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
this.Text = "Updating";
thisDeployment.Update(); //Update here
MessageBox.Show("Done, restart now");
Application.Restart(); //Restart application
}
else
{
this.Text = Application.ProductName + " " + Application.ProductVersion;
}
}
else
{
MessageBox.Show("You have the latest release!");
}
}
else
{
MessageBox.Show("This is not a ClickOnce Application");
}
}
Hopes this helps,
Regards
Hi, Razer1911,
You can use clickonce to deploy your application and it updatesautomatically.
ClickOnce tutorial
http://msdn2.microsoft.com/en-us/library/t71a733d(VS.80).aspx
If you want to update manually,
thenyou don't need to choose "The application should check for updates",
just use some logic to trigger the update.
For example
Code Snippet
private void saveButton_Click(object sender, EventArgs e)
{
if (ApplicationDeployment.IsNetworkDeployed == true)
{
ApplicationDeployment thisDeployment = ApplicationDeployment.CurrentDeployment;
this.Text = "Checking update!";
if (thisDeployment.CheckForUpdate() == true)
{
if (MessageBox.Show("New Version detected, update now?", "Update Now?", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
this.Text = "Updating";
thisDeployment.Update(); //Update here
MessageBox.Show("Done, restart now");
Application.Restart(); //Restart application
}
else
{
this.Text = Application.ProductName + " " + Application.ProductVersion;
}
}
else
{
MessageBox.Show("You have the latest release!");
}
}
else
{
MessageBox.Show("This is not a ClickOnce Application");
}
}
Hopes this helps,
Regards
You can use google to search for other answers