Publish data file with updates?
I have successfully created and published a VB 2005 program with a SQL database. It installs on the user's system fine.
My question is when I update the program, what should I do with the data file? I need to include it in case someone is doing a brand new install with the newer version. But if the original user installs the update, they get the data file overwriting what's currently on their system which obviously is no good.
What is usually done in this situation? I'm using the clickonce deployment so I can't really change anything during the install besides excluding the file.
Greg
Re: Publish data file with updates?
I have never used Click Once so what I say is experimental! If you can only include or exclude the database then you don’t have any option except that you don’t include the database but create it through the code if it does not exist. So when you update the program you don’t have to do anything.
Re: Publish data file with updates?
Quote:
Originally Posted by VBDT
I have never used Click Once so what I say is experimental! If you can only include or exclude the database then you don’t have any option except that you don’t include the database but create it through the code if it does not exist. So when you update the program you don’t have to do anything.
Just for my own information then, how would you handle this situation when you don't use Click Once?
Re: Publish data file with updates?
I would have the installer to check if there is a database then do nothing, if there isn't then install the database. in the installer project you can condition the database file installation!
1 Attachment(s)
Re: Publish data file with updates?
I think you should have it too if you can access the target machin window.
Re: Publish data file with updates?
Using click once, I don't have anything like that screen. From Visual Basic Help, this is what happens to SQL files:
Quote:
Include the data file in the manifest and copy to the publish location when the publish command is executed.
Any non-assembly file for which Build Action is set to Content can have this publish status. Files with extensions .mdf, .ldf, and .xml are set to Data File by default.
Files of this type will be installed to the data directory. When an update to the application occurs, a data file may be migrated by the application.
When an update to the application occurs, migrate the information in this file into the next version of the application.
Maybe I'm being dumb, but what do they mean by migrate? Is this more of a merge than an overwrite? It seems like it is doing a complete overwrite to me, leaving me with whatever data is in the database of the update.
Re: Publish data file with updates?
Well guess i will dredge up an old thread.
I was using the publish feature on a windows app and I thought I had my settings right to not overwrite the database however I must of been wrong.
Because a user took my update and lost all there data arghh. So what is best way to handle this? I dont want to make any other users frustrated :)
I thought if I had the "copy to output directory= do not copy" i wold of avoided this.
So how do i avoid this? Maybe i changed the publish location..dunno
thanks
Quote:
Originally Posted by ghall426
Using click once, I don't have anything like that screen. From Visual Basic Help, this is what happens to SQL files:
Maybe I'm being dumb, but what do they mean by migrate? Is this more of a merge than an overwrite? It seems like it is doing a complete overwrite to me, leaving me with whatever data is in the database of the update.