The only way I can think about removing myself and leaving no traces is to use something already present in the device, namely wceload (CAB extractor). I would create a simple CAB file with a custom installation of the DLL, which will wait and then delete.
Then I will add the CAB to the application as an embedded resource. When you need to remove you
- extract the cab to the file system
- execute wceload.exe with CAB as a parameter and / noui (or / silent)
- Close the application
Then CAB deletes your file (named mutex can synchronize this better than just calling sleep in a DLL). wceload automatically removes the CAB (well, depending on the version of WinMo, but there is a switch to force removal if necessary).
This, of course, is a hack, but it will provide a "leave without a trace" removal. Of course, CAB may have to clean its own registry entries for installation. Perhaps you can simply set the installation to “failure” so that they are not recorded first.
ctacke
source share