Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

updating a program w/ lots of users

Hello all you people that are way smarter than myself!  
   I write software for a company, and we just released a program that obviously will have bugs in it.  I was wondering if there is any easier way of updating when we create  a new EXE instead of sharing into everyone's computers one a a time and replacing it.  Also, it can't be replaced when the program is running, so we have to kick them off and replace it.   Thanks for your time.  
1 Solution

This is what we have done. You need to create a program that will do the updating, a database to verify that the user is using the current release, and a network share to place the latest release of the software.

I am taking it that you are creating a Visual Basic application and you are using a SQLServer database (you can use an access database).

In the database your would create a table to keep track of the updates and for your application to check if it is running the latest and greatest.  In our table we maintain the workstation name (you can get the workstation name in the application by calling the advapi32.dll), the application name (for use with multiple application, you can get this with the app.EXEName), the network share the updated a application resides on (can be different per workstation) and a boolean flag that tells the user application that the machine needs the latest release.

In your application the first thing you do is check the table against your computer name, the name of the application and if the boolean update field is marked. If these conditions are meet you call your update program (using the 'Shell' command). Pass in any parameters you need, we use the connection string to the database (so we can use this on other network with other databases).  Then terminate the application (using the 'End' command).

The update application will then use the connection string you passed in (using the 'Command' property) and will look at the update table in your database for you computer name and application name.  It is also a good idea to put a splash screen with a timer in the update application to allow your application to close and to notify the users of an update.  You can also allow the user to skip a download untill next restart.  The table in the database will tell your update program what network share the latest application's exe resides.  The update application will then download the latest application over your current application (using 'FileCopy').  Then the update program will turn off the update flag and start your application again (using the 'Shell' command).

You can add other flags like operating system, archive, if it needs to include other files or register new libaries.

If you want the users to get notified while they are running the application you can include a timer in your application that check if a new release is available.  You might what to disable this feature in later releases so your users don't pound the database.  

Another option is a DCOM event, but that is a lot more painfull!!

Eric Deiter - MCP
Software Developer
afeldAuthor Commented:
Nice!  Thanks, that is exactly what I need.  You guessed it, VB and SQL.   Thanks a lot!

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now