none
Click Once Deployment - Auto Alert the User on new version.

    Question

  • Hi all,

    Im facing a difficulty in giving an alert to the user, that a new version of the application is avaliable when the user is using the older version.

    Please help me to sove this problem.

     

    Tuesday, May 31, 2011 9:52 AM

Answers

All replies

  • you should do this outside clickonce functions, for example the client should check with server latest version in a ThreaPool thread often and when new version is available popup a warning in main UI thread instructing user to close and open the app for an update.

     

    Tuesday, May 31, 2011 2:29 PM
  • You can use the ClickOnce update API to do the update programmatically.

    http://msdn.microsoft.com/en-us/library/ms404263.aspx

     

    Then you can show user a alert to see there's new version after you check there's really a new version could install.

    if (info.UpdateAvailable)
        {
          Boolean doUpdate = true;
    
          if (!info.IsUpdateRequired)
          {
            DialogResult dr = MessageBox.Show("An update is available. Would you like to update the application now?", "Update Available", MessageBoxButtons.OKCancel);
    

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 01, 2011 12:17 PM
    Moderator
  • Why not use the auto-update feature? It will automatically check for updates and install them before running the application. You can decide whether the updates need to be required or not.

    This is set in the Updates dialog in the Publish tab of your project's properties.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Sunday, June 05, 2011 9:20 PM
    Moderator