Meta dll finished updating
We used a service or another executable to detect upgrades, download them and then launch the installer, that took care of detecting running applications and locked shared files, now we're using our install tool update feature.
This also works if application is using some DLL(s) part of it.Approaches that try to replace a file in folders on which user have no permission to write can't work in properly configured environments - unless the program or user privileges are elevated.We prefer to rely on Windows Installer and .msi/files to deploy upgrades - they get "registered" within Add/Remove apps too.Using either HTTP or custom protocol it would contact server, request a new file and download it (supported multiple files).The difference with yours is that I replaced the executable file itself (simulated) without having a helper app as such.Windows will count them as no longer in use, so all overwrites are working.
I'm using this procedure in application with 6 additional DLLs and it proves working over a year and a half. We use a similar setup to deploy our application, except that the initial downloaded file is an xml file with all the metadata we need to decide to update the file.
When the wait completes it can replace all executables and dlls that were previously locked.
You'll need to use the following Windows APIs: - Wait For Single Object: using this the updater doesn't need to test for the main application in a loop. - Duplicate Handle: the main application needs to duplicate its own process handle for SYNCHRONIZE access in order to allow another process to wait for it.
I have the need to deploy a program that can update itself. When the program starts it downloads a file from the web, which contains the version number of the latest edition (this file is maintained manually, I though about extracting the version number but the site is deployed on Linux and it needs to be very fast in case many users download the program). There is a little extra code I'm adding for to comply with Vista protection, but more or less it works.
If the number there matches the internal version (extracted from the version information), that's OK. Now I know I have to update this strategy a little, as I might need to update other files like DLLs that are statically bound, so again they can be replaced only by stopping the program. and will soon let you know about this "soon-to-be-free-for-all" program I resumed working on...
I don't work with Delphi anymore for a long time, but once I used the following a approach: 1.