by TimStone » Fri Jun 16, 2017 5:13 pm
Sorry to weigh in late on this. I not only had the need to auto install updates, but I also wanted to do backups everynight of all the data on the machine, and submit data for 3rd party vendors used by the clients.
I built an "AutoUpdate" executable on the primary machine. Every 3 hours it queries our server to see if there is an update. It also downloads a "keyfile" from our server which has a file ( encrypted ) of clients, and their version authorizations. I also have a rental program, so it contains the shut off date it payments are not received ( or the new extended authorization date when they are ). In the middle of the night ( after midnight ) when people are not likely on the system, it creates a backup archive file ( zip ) which it saves to a specified destination ( usually an external drive ), and it submits data to those vendors. Finally, it also sends emails to clients based on settings in the system ( especially thank you notes and reminders ).
When a new update is available, it does have the same name as the client executable, but it is downloaded to a sub folder on the primary (server) computer. When a person starts the client on their workstation, it actually calls a "run" program which checks for new copies of the .exe and .chm files on the server, and copies them to the local machine. Then it starts the client executable.
This system has been in place for many years, and it works beautifully. Sometimes when adding a new capability to the software, it can take a few "fine tuning" updates ... and of course if there is an error, it can be fixed and made available immediately.
The auto updater runs 24/7 and right clicking on the icon will bring up a menu where the log can be displayed, and also a person can do an immediate update request. So, in our "real world" if someone finds a bug that interferes with their operations, calls it in at 8:00 am, by 8:10 it is fixed, a new .exe is built and pushed to the server, and they can manually request an update. Thus, they can be running bug free by 8:15. Since most bugs are typos, fixes are usually very fast, and this operation is very easy.
The actual code is rather simple ... just write it to generally avoid any screen displays so it is fast and efficient.
I've tried to build this as a windows service, and so far have not been successful. I believe it will happen in the near future, however, once I determine which library elements ( unused but present ) are blocking that ability.
Tim