views:

347

answers:

5

I can get the program to easily, upon startup, look for updates and then install them.

I want to have a button that the user can click that will check/install updates. Is this possible, if so how?

Edit: Sorry all, not ASP.NET; VB.NET only

A: 

This is not difficult. Presumably the update/install code is in its own routine. In the button's click event code, simply call the update/install routine used by the startup code.

Pesto
Where can I find the update/install routine used by the startup code? I am fairly new to VB.Net programing, so I may be over looking it. Right now the program handles it automatically via ClickOnce....
Bruno43
A: 

Add an event to the button. In this event, you use something like the WebClient to retrieve an newer installation package from your server. Then verify its signature to make sure the code is really yours and install it on the local machine.

driAn
Any examples of this?
Bruno43
No, haven't the code here atm. But the usage of WebClient is straight forward..
driAn
A: 

I noticed the asp.net tag on your question. Are you talking a desktop app or like from an admin page of a customer installed web application?

If it's a desktop app, just look into a ClickOnce deployment. It has that functionality built in.

Joel Coehoorn
Sorry, I took the ASP.net tag out.
Bruno43
If I am not mistaken, the ClickOnce deployment only allows the program itself to check for an update upon startup automatically. I want to give the user the ability to check for the update.I'm sorry if my understanding of the ClickOnce deployment is wrong.
Bruno43
ClickOnce also has a web page where users can see what the latest version is. If the user wants to upgrade, they simply restart the app.
Joel Coehoorn
A: 

Either I am not getting the big picture or it's because i work on a asp.net environment...

Anyway, I did something like you asked for our products (web applications) and it was anything but a simple task.

Here is how I did it: 1 - Build a back office application to release new product versions.

2 - Build a webService that received a given product and a version, checked if there was an update available, if so send it to the client.

3 - On the client when received an update, installed it.

I guess the update process will be easier to do on a windows application, my only advice is to be extremely careful when doing it. Always make a safe copy of your application so if anything goes wrong you can roll-back to the previous version.

Sergio
+2  A: 

This msdn page outlines your different options for ClickOnce updates. It explains how to check for updates before your application starts, after you application starts, or programmatically.

My guess is that you would probably want to combine one of the automatic checks (before or after application starting) with your programmatic check (on your button click).

whatknott
Thank you for the reference. It was exactly what I was looking for.
Bruno43