Search code examples
c++visual-studiocompact-frameworkcab

Keep files within a folder at cab app uninstall


I would like some files within a folder not to be deleted when a cab application is uninstalled on a handheld device. I read that this is possible if you create a custom setup dll.

I could create a project in VS, but i don't know what C++ code should i write there, in the Uninstall_Init function in order to prevent some files to be deleted. Do you have any suggestion?

It would be possible to obtain this through manipulating the .inf file?


Solution

  • Even if you add a setup dll, you need to temporary copy the files to keep in the Uninstall_Init() function, before the uninstall removes the files. Then there is also an Uninstall_Exit(), which is called by the uninstaller after the install. You can use that function to move the copied files back to there location.

    There should be an Setup DLL example code within your Windows Mobile SDK installation.