views:

173

answers:

3

How do I set up automatic updates for my program in Visual Basic 2008?

I would like the user to be able install the program from a setup.exe file then run the auto update function within the program. How do I do this in Visual Basic 2008?

+3  A: 

Assuming that you are writing a client application, ClickOnce is probably the best/easiest way to go.

Andy
Does this still require that the application be only installed for the current user? I heard this was an issuer with versions before 2008.
Jeff O
I can't seem to get this ClickOnce stuff to work the way I want it to. I've tried it before and it seems buggy / a non-standard way of updating a program.I'd like the program to install like a regular application, and then have the automatic updates be available to the user through a button click. Is this doable by making the program into a DLL or something?
CowKingDeluxe
I've never personally used ClickOnce to deploy an app, only to play around with it. I think by default it automatically checks for updates on startup, but I believe that can be configured.I'm not sure if it can be configured how the app gets installed, but I believe that it gets installed per-user by default.
Andy
+3  A: 

If you don't go the ClickOnce option, then you'll probably end up tooling it yourself.

One of the considerations will be that the calling client has access to the update server -- undoubtedly over the web. HTTP calls on port 80 or HTTPS on port 443 are typically allowed through firewalls. That's probably a good place to start for your medium.

I've deployed a project which does this sort of thing by performing a call to a web service to determine if an update is available. The web service looks at a directory on our web server and examines a convention we have for a named zip file. The calling client makes a determination based on the versioning of whether an update is available.

If an update is available, the app spawns an executable that does the downloading (in my case it unzips as well), then re-launches the main entry point to the app and exits the updater. Using a separate executable in a spawing/shelling manner allows you to update the main trunk of the app, but you get into trickiness where it's cumbersome to update the update executable.

It's not as graceful as ClickOnce, but it's worked well for me. I haven't used ClickOnce, so I'm not aware of whether it has shortcomings in terms of user profile isolation.

Mike L
I'd upvote this one and the above one but it says I don't have enough rep. Thanks!
CowKingDeluxe
A: 

You'll have to roll your own or use ClickOnce.

Here's Microsoft documentation on using ClickOnce's update mechanism.

Nicholas H