0

Using VD2010 Microsoft Deployment Project (MSI)

My application has a database (SDF) that the customer uses to enter all their data, when you uninstall I need to ensure the SDF file remains (so I set Permanet == true) but I also need to ensure that when they install a new version of the application I do not overwrite their copy with the empty/blank DB I install on first use....

Is there anyway to ensure this, or prompt, or something to ensure the customer doesn't loose all their data when they install a new copy?

Thanks,

JSchwartz
  • 2,536
  • 6
  • 32
  • 45

2 Answers2

1

From a Windows Installer perspective, an SDF is simply a non versioned file. If you make it the keyfile of it's own component and use the default file versioning rules then Windows Installer will evaluate it as such. The behavior will be that if the SDF has the same creation and last modification date, it will get overwritten. If it has a different creation and last modification date it will not get overwritten. This would seem to make sense to me based on the intent of the SDF file.

Another approach would be to install a template SDF file and have the application copy the template to the real database file. This way MSI never knew anything about the "real" SDF file in the first place. It can't service user data that it doesn't know about.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

If you include sdf file in the MSI installation it will just copy the sdf database file. It won't provide any error in case of sdf issue. It will complete the installation successfully even if the sdf file is crashed. You can try to provide any check on the db and rollback the installation in case of db error.

Herman
  • 1