al17nichols 0 Posted February 5, 2022 I want to create an application that can check for updates and if needed download new an update before launching. The application will contain multiple forms and some threads to monitor tidtcpclient (socket) connections. My thought was to create a thin application what would check for version updates on a remote server. After checking and downloading (if necessary) i could launch the application. Should the secondary (core of the application) be a .dll or should I call the windows API that that launches a second application? Share this post Link to post
David Schwartz 426 Posted February 6, 2022 TMS Web Update https://www.tmssoftware.com/site/wupdate.asp 1 Share this post Link to post
Guest Posted February 6, 2022 (edited) If i understood you question correctly, maybe this helps? You must click on the first line in the "card" above. Edited February 6, 2022 by Guest Non optimal link by DP Share this post Link to post
qubits 20 Posted February 6, 2022 21 hours ago, al17nichols said: create an application that can check for updates and if needed download new an update before launching. if it's an application, the easiest answer is in the first sentence.. make a launcher that checks for updates then launches main app, then exits.. I can also second Dave's recommendation as I've used TMS as well and it works great, no second app to maintain. 1 Share this post Link to post
aehimself 396 Posted February 6, 2022 (edited) No need for a launcher, a single .EXE can do it - at least on Windows. Windows allows to rename the executable even if your application is running. So the steps are... - Download the updated .exe, and save it e.g. .exe.new - Rename the current application (Application.ExeName) to .exe.old - Rename the updated file .exe.new -> .exe - Launch the .exe and immediately quit - It's a good practice to wait for the previous process to actually die before doing any actual work, like reading settings up, etc. - Upon startup check and delete any .exe.old files I'm using this method and it works like a charm. Edited February 6, 2022 by aehimself 6 Share this post Link to post
al17nichols 0 Posted February 7, 2022 Great answers. I can appreciate the ability to rename the exe and quit, but That is not quite a smooth as a launcher. If I used a launcher do I need to create the main as a .dll or launch it with the Windows API. I can't remember but I used it quite some time ago. Share this post Link to post
qubits 20 Posted February 7, 2022 i can also second ae's approach, especially if you wanted some automation. app launches, check Application.ExeName, if it's the orig, copy orig to newname, launch newname, then exit. now you can update orig exe as needed. Launcher app approach is typically just another application that executes the other after checking for and applying updates. Share this post Link to post
Fr0sT.Brutal 900 Posted February 9, 2022 another +1 for AE's answer. Simple and reliable. Nice option for those who wasn't seduced by Dark Side that preaches installing separate updater service Share this post Link to post