MSI distribution problem
So, I keep testing and releasing changes in my application and I ran into pain that I don't know how to deal with.
First, my application uses a SQL Server CE database to store information, and I need to be able to make changes to this db, so I created an internal update process that runs whenever the application starts to make sure the db is up to date.
The gist of this internal update process is another SDF file named DBUpdates.sdf that contains all the db schema changes that need to be applied.
The problem I am facing is that the generated MSI distro will not overwrite this file. It looks like when SQL Server CE opens this file, it changes the Modified Date / Time of the file. This is the MSI process flag that the file has changed and that it should not overwrite the file. Well, now I can see that my changes in the db are not being applied because the MSI process thinks that the user has changed this file.
At this point, I'm a little dumb. I was planning on using the MSI distribution, but maybe I can't. What do you think?
Unversioned MSI files can be a little difficult to handle if you need to force a file to be installed. You can see this previous question, for some ideas, How to add a version number to an access file in .msi format .
The question contains a link to this blog post http://blogs.msdn.com/astebner/archive/2005/08/30/458295.aspx which talks about how I prefer to deal with this issue. Add a .sdf file to be part of the executable component. The downside to this is that if someone deletes the .sdf file but not your executable, I don't think the application fix will catch that. If you are using Visual Studio to create MSI files, this can be a difficult decision to implement. I highly recommend that you check out WIX in this case. It is an improved MSI build system.
a source to share