What's the best way for a .NET Compact Framework executable to uninstall it?

I want my .NET Compact Framework application to uninstall itself after it finishes executing. What's the best way to do this?

On a Windows machine this can be done with a .bat file, but this is not an option on mobile devices.

+1


source to share


3 answers


Windows Mobile has a directory:

\ application data \ volatile

This directory is kept as long as the device is powered.



So what we do:

  • copy the exe to that directory or subdirectory (I usually use the subdirectory to make sure we don't run into another application).
  • run exe from that directory.
  • delete the files you want.
  • (optional) soft-reset.

For compatibility with all devices, you must use the SHGetSpecialFolderPath function with CSIDL_APPDATA to get the application data directory and add "\ volatile" to it.

+2


source


One idea is that you can use wceload:

http://msdn.microsoft.com/en-us/library/bb158700.aspx

Write a cockpit file with a custom pitch (I think you might need to create a setup.dll file) that will uninstall your application.



Get your application to call wceload when it exits to start this booth by passing an argument to load wce to remove the booth after it finishes.

I don't know as far as I know.

0


source


Write your own deleter.exe program and run it to remove the main exe, but you have to leave that on the device ... if your device does not have a ram driver on which you can run deleter.exe that it will disappear on reboot.

0


source







All Articles