I searched for a good solution for 3 days, but so far I have not been able to find it. My situation:
The client has an installed application (C ++, console application). The application at startup checks its version number on the server and returns or is updated, or that it should download the new version.
If he needs to download a new version, I would like to download a new script using Curl for the name say: Application2.exe
However, I want it to replace the old Application.exe , which caused the new version to load.
My solution was: Application.exe loads Application2.exe . When loading, it should run Updater.exe , which sleeps, let them say 5 seconds. During these 5 seconds (or any other period of time that is best suited). During these 5 seconds, Application.exe has time to shut down and after 5 seconds Updater.exe replaces Application.exe with Application2.exe .
Now the update is completed, and the client has the latest version installed.
Is this possible with respect to system lock files, etc.?
source
share