I have a .net cf 3.5 Windows Mobile application that my client wants to have autoupdate features.
Here is what I have so far:
I just published WmAutoUpdate, a .NET c# framework that will do auto-updates on the Compact Framework. It's freely available on Github: http://github.com/seboslaw/wmautoupdate
It is not necessary to create a dedicated app to update, at least not on WM 6 with .netcf 3.5. I'm downloading .cab file using a webservice and then start a new process and invoke wceload to do a silent cab install. This takes care of shutting down my running app, uninstalling it and then performs the install like stated in MSDN docs here
In Windows Mobile Version 5.0 and later, when using Wceload.exe to reinstall a .cab file, Wceload.exe uninstalls the previously installed version of the .cab file before installing the new version. During the uninstallation portion of this process, Wceload.exe closes any currently running executables that were installed on the target device using a .cab file, based on their filename. Wceload.exe also closes any executables that are the target of a file operation, such as a move or a copy. To close an executable, Wceload.exe sends WM_CLOSE to all top-level windows owned by the process. If the process does not exit in a timely manner after receiving the WM_CLOSE message, then Wceload.exe forcibly closes it by calling TerminateProcess. Wceload.exe does not attempt to close executables that are shipped in the run-time image on the target device.
I also have a cesetup.dll for additional cleanup of files during uninstall.
The big problem i have is that i cannot change the installation folder for my app when doing a silent install and it defaults to %installDir% property from my .inf file. And building a separate .cab for every device that wants to update is not a pretty solution.
You are right. after wM5, 6... WCEload just stops the aplication if it's installed, so you don't need to stop it manually. but You need to install the update in silent mode because if not the user can cancel it, so you need the silen cab installer. download it from
http://cssoft.freehosting.net/website2/default.html
Your solution is generally correct, but has a few problems.
An old, but still very valid, resource is Alex Feinman's MSDN article on creating self-updating applications.
A team I was on implemented this by creating a second mobile app (outside of the application that is being updated) on the mobile devices that was responsible for downloading and running CABs.
This worked for us pretty well.