1

I'm making .cab file for deploying my application on mobile devices (Windows Mobile 6.5). I create it "manually" with cabwiz.exe, because Visual Studio 2008 has problems with CAB projects (they are described quite well, localization files is one issue).

Everything is fine except that Windows Mobile deletes all installed files when user uninstalls the application. I want to keep some file after uninstallation in case if another version of the application will be installed.

Now the only way to preserve files from deletion during uninstallation is to rename them. Is there any better do this?

Fedor
  • 1,392
  • 1
  • 17
  • 30

1 Answers1

1

The CAB installer will uninstall everything it knows that it installed. It will not delete files that were created at run-time. If you have something like a config file, simply rename it at app startup and use the renamed file in your app code. When the uninstaller removes the app, it won't know about the rename and will leave that file alone.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • This is what I currently do. But because I have more files to be left after uninstallation than just a single config file, I thought there could be another way... Anyway thank you for the response. – Fedor Oct 11 '11 at 06:45
  • 1
    @Fedor - an easy way to do this would be to give all files in your project that you want to keep some special name like `renameMe-file1.ext`, then have your startup run a tiny piece of code to rename all files by trimming the file names to what they should be, like `file1.ext`. Just an idea. That should support any file name and any extension. –  Oct 11 '11 at 13:00
  • @jp2code good idea, i'll do something like that. very surprised that application manager doesn't support this. – Fedor Oct 11 '11 at 18:21