How to trigger 'Automatic update' manually?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: How to trigger 'Automatic update' manually?

  1. #1
    Join Date
    Mar 2008
    Location
    Blaricum, The Netherlands
    Posts
    78

    Question How to trigger 'Automatic update' manually?

    Hallo,

    one of my applications uses the built in 'automatic update' feature from VB.NET.
    (You know.... Open 'My Project', tab 'Publish', button 'Updates'.)

    However.....
    I would like to give the user the possibility to manual search for updates.

    How can I trigger the 'update process'?

    Friendly greetings
    Rens Duijsens
    The Netherlands

  2. #2
    Join Date
    Sep 2007
    Posts
    86
    Yes, this is possible with a little code. There is a great post that has some sample code here: http://searchwindevelopment.techtarg...278204,00.html

    You may want to read throught the post for more info, but here is the code you are interested in (taken directly from the article linked above):

    Code:
    private void OnUpdateApplication(object sender,
       EventArgs e)
    {
       ApplicationDeployment deployment =
          ApplicationDeployment.CurrentDeployment;
       if (deployment.CheckForUpdate())
       {
          deployment.Update();
          MessageBox.Show("Update downloaded, application" +
             "will now restart.");
          Application.Restart();
       }
       else
       {
          MessageBox.Show("No updates available");
       }
    }
    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Thanks for the link John!

    I've been looking for a good link to provide folks for Click Once.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  4. #4
    Join Date
    Mar 2008
    Location
    Blaricum, The Netherlands
    Posts
    78
    Thanks for the link.
    I'll test it.

Similar Threads

  1. Replies: 11
    Last Post: 09-23-2009, 03:09 AM
  2. SQL 6.5 Before Update trigger
    By Terry in forum ASP.NET
    Replies: 2
    Last Post: 03-31-2003, 05:35 PM
  3. Update Trigger
    By Paul in forum Database
    Replies: 2
    Last Post: 09-25-2002, 03:25 AM
  4. Update Trigger
    By Leon Parker in forum Database
    Replies: 2
    Last Post: 09-24-2002, 12:10 PM
  5. Multiple triggers or one large update trigger
    By tim cronin in forum Database
    Replies: 0
    Last Post: 05-01-2001, 01:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center