Results 1 to 3 of 3

Thread: [RESOLVED] Publishing A Mandatory Update With ClickOnce

  1. #1

    Thread Starter
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Resolved [RESOLVED] Publishing A Mandatory Update With ClickOnce

    I'm trying to add an automatic update feature if there is a mandatory update for my application using something like this:

    vb.net Code:
    1. 'Check for mandatory updates
    2.     Private Sub MyApplication_CheckForUpdateCompleted(ByVal sender As Object, ByVal e As Deployment.Application.CheckForUpdateCompletedEventArgs)
    3.         If e.UpdateAvailable AndAlso e.IsUpdateRequired Then
    4.             AddHandler My.Application.Deployment.UpdateCompleted, AddressOf Me.MyApplication_UpdateCompleted
    5.             My.Application.Deployment.UpdateAsync()
    6.         End If
    7.     End Sub
    8.  
    9.     Private Sub MyApplication_UpdateCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
    10.         If e.Error Is Nothing Then
    11.             MessageBox.Show("The application has installed a mandatory update and needs to be restarted.", "Update installed", MessageBoxButtons.OK, MessageBoxIcon.Information)
    12.             RemoveHandler My.Application.Deployment.UpdateCompleted, AddressOf Me.MyApplication_UpdateCompleted
    13.             Application.Restart()
    14.         End If
    15.     End Sub
    My question is: how do I publish a mandatory version? I see no way of specifying when you publish that it is a required update.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Publishing A Mandatory Update With ClickOnce

    On the Publish tab of the Project Properties dialog click on the Updates button and specify the minimum required version, make sure the Publish Version is the same.

  3. #3

    Thread Starter
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Publishing A Mandatory Update With ClickOnce

    I figured it would be something easy, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width