Update checks now gives notification when the application is already up-to-date.
authorsl
Sat, 17 Jan 2015 10:57:30 +0100
changeset 90aa157e129c42
parent 89 0e8c077d63bf
child 91 61e2e2d41c0a
Update checks now gives notification when the application is already up-to-date.
Adding version number to main form text.
Server/MainForm.cs
Server/SharpDisplayManager.csproj
     1.1 --- a/Server/MainForm.cs	Fri Jan 16 09:50:19 2015 +0100
     1.2 +++ b/Server/MainForm.cs	Sat Jan 17 10:57:30 2015 +0100
     1.3 @@ -74,6 +74,15 @@
     1.4  
     1.5          private void MainForm_Load(object sender, EventArgs e)
     1.6          {
     1.7 +			if (ApplicationDeployment.IsNetworkDeployed)
     1.8 +			{
     1.9 +				this.Text += " - v" + ApplicationDeployment.CurrentDeployment.CurrentVersion;
    1.10 +			}
    1.11 +			else
    1.12 +			{
    1.13 +				this.Text += " - development";
    1.14 +			}
    1.15 +
    1.16              StartServer();
    1.17  
    1.18              if (Properties.Settings.Default.DisplayConnectOnStartup)
    1.19 @@ -1353,43 +1362,47 @@
    1.20                      return;
    1.21                  }
    1.22  
    1.23 -                if (info.UpdateAvailable)
    1.24 -                {
    1.25 -                    Boolean doUpdate = true;
    1.26 +				if (info.UpdateAvailable)
    1.27 +				{
    1.28 +					Boolean doUpdate = true;
    1.29  
    1.30 -                    if (!info.IsUpdateRequired)
    1.31 -                    {
    1.32 -                        DialogResult dr = MessageBox.Show("An update is available. Would you like to update the application now?", "Update Available", MessageBoxButtons.OKCancel);
    1.33 -                        if (!(DialogResult.OK == dr))
    1.34 -                        {
    1.35 -                            doUpdate = false;
    1.36 -                        }
    1.37 -                    }
    1.38 -                    else
    1.39 -                    {
    1.40 -                        // Display a message that the app MUST reboot. Display the minimum required version.
    1.41 -                        MessageBox.Show("This application has detected a mandatory update from your current " +
    1.42 -                            "version to version " + info.MinimumRequiredVersion.ToString() +
    1.43 -                            ". The application will now install the update and restart.",
    1.44 -                            "Update Available", MessageBoxButtons.OK,
    1.45 -                            MessageBoxIcon.Information);
    1.46 -                    }
    1.47 +					if (!info.IsUpdateRequired)
    1.48 +					{
    1.49 +						DialogResult dr = MessageBox.Show("An update is available. Would you like to update the application now?", "Update Available", MessageBoxButtons.OKCancel);
    1.50 +						if (!(DialogResult.OK == dr))
    1.51 +						{
    1.52 +							doUpdate = false;
    1.53 +						}
    1.54 +					}
    1.55 +					else
    1.56 +					{
    1.57 +						// Display a message that the app MUST reboot. Display the minimum required version.
    1.58 +						MessageBox.Show("This application has detected a mandatory update from your current " +
    1.59 +							"version to version " + info.MinimumRequiredVersion.ToString() +
    1.60 +							". The application will now install the update and restart.",
    1.61 +							"Update Available", MessageBoxButtons.OK,
    1.62 +							MessageBoxIcon.Information);
    1.63 +					}
    1.64  
    1.65 -                    if (doUpdate)
    1.66 -                    {
    1.67 -                        try
    1.68 -                        {
    1.69 -                            ad.Update();
    1.70 -                            MessageBox.Show("The application has been upgraded, and will now restart.");
    1.71 -                            Application.Restart();
    1.72 -                        }
    1.73 -                        catch (DeploymentDownloadException dde)
    1.74 -                        {
    1.75 -                            MessageBox.Show("Cannot install the latest version of the application. \n\nPlease check your network connection, or try again later. Error: " + dde);
    1.76 -                            return;
    1.77 -                        }
    1.78 -                    }
    1.79 -                }
    1.80 +					if (doUpdate)
    1.81 +					{
    1.82 +						try
    1.83 +						{
    1.84 +							ad.Update();
    1.85 +							MessageBox.Show("The application has been upgraded, and will now restart.");
    1.86 +							Application.Restart();
    1.87 +						}
    1.88 +						catch (DeploymentDownloadException dde)
    1.89 +						{
    1.90 +							MessageBox.Show("Cannot install the latest version of the application. \n\nPlease check your network connection, or try again later. Error: " + dde);
    1.91 +							return;
    1.92 +						}
    1.93 +					}
    1.94 +				}
    1.95 +				else
    1.96 +				{
    1.97 +					MessageBox.Show("You are already running the latest version.", "Application up-to-date");
    1.98 +				}
    1.99              }
   1.100          }
   1.101      }
     2.1 --- a/Server/SharpDisplayManager.csproj	Fri Jan 16 09:50:19 2015 +0100
     2.2 +++ b/Server/SharpDisplayManager.csproj	Sat Jan 17 10:57:30 2015 +0100
     2.3 @@ -30,7 +30,7 @@
     2.4      <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     2.5      <WebPage>index.htm</WebPage>
     2.6      <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
     2.7 -    <ApplicationRevision>12</ApplicationRevision>
     2.8 +    <ApplicationRevision>14</ApplicationRevision>
     2.9      <ApplicationVersion>0.1.0.%2a</ApplicationVersion>
    2.10      <UseApplicationTrust>false</UseApplicationTrust>
    2.11      <CreateDesktopShortcut>true</CreateDesktopShortcut>