The App Update demo uses a button to initiate the update process, and works correctly. I am attempting to use the component to update automatically. I placed the StartUpdate call in the OnShow event of the form.
The application updates correctly but leaves the old version running. The old version is not visible and must be killed with the task manager. Where should I put the call to StartUpdate to prevent the _.exe from staying active?
StartUpdate is depending on the configuration file to be downloaded first. The demo works because it calls the
NewVersionAvailable which downloads and checks the configuration file.
You can either call
NewVersionAvailable manually before
StartUpdate similarly to the demo or you can use
DoUpdate instead which will do these two steps for you in one.
Of course, I am calling NewVersionAvailable before StartUpdate.
My actual code is in a unit that adds several features to simplify the use of the component. Effectively, it does the following: if NewVersionAvailable then StartUpdate else ShowSplashForm;
Unfortunately, the original executable, renamed to *_.exe, is not being closed when the application restarts. My question is related to that. I will email the project using the unit along with a working version that does not use the unit.
It's indeed best to send a sample in this case as we are unable to reproduce what you are experiencing.
I realized the issue was the main program needed to know if an update had been performed.
I changed my update routine from a procedure to a function. The application closes the main form when an update has taken place. This resolved the issue.
Thanks for your assistance.