Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > over write newer files that do not support versioning
 

over write newer files that do not support versioning

I am having a problem with a Visual Studio 2008 setup and deployment project. The easiest way to describe the problem is by way ofa simple example that copies a file into a directory on a client machine. The problem occurs when a version of the file being copied already exists on the client machine.

If the file on the client machine is newer than the file being copied, the copy does not take place and no warning is given! What I want is for the file to be copied irrespective of whether there is an existing file or what ever version that file happens to be.

If the file being copied supports versioning then there is no problem, the problem arises when the file does not support versioning, for example an Access database file (accdb or accde) containing the latest company figures.

At present the only way round the problem that I can find is to perform the "installation" in which the file is not copied, to then uninstall which removes the originalfileand then to install again which will nowinstall the correct file! Not a very nice work around.

I would be most grateful for any help in this regard.

Thank you,

infrazee
infrazee  Friday, August 07, 2009 8:48 AM
There's a way you can modify the MSI file after it's built, at ther end here:
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/4ceda905-84c9-42f4-b9b3-2137453fb598/
Phil Wilson
  • Marked As Answer byinfrazee Tuesday, August 11, 2009 5:00 PM
  •  
PhilWilson  Monday, August 10, 2009 9:44 PM
The standard file version replacement rules are that newer versions always win over lower versions. This is because the new version contains added functionality or fixes that you don't usually want to take away. That's normal, and I think you're saying that's ok.

For non-versioned files with VS upgrades (RemovePreviousVersions) the replacement rule is that the file will not be replaced if it has been changed after first installation. If you install a database, then it gets updated with data, then you do an upgrade, thennobody really wants to see all that data get lost during an upgrade. What's odd is that you're shipping a database with company figures that must begetting updated after it's been installed. Is that what you expect?
Phil Wilson
PhilWilson  Friday, August 07, 2009 5:32 PM
To Phil Wilson,

Thank you for your response.

The application is unusual in that it effect I do indeed want to see all the data lost during an upgrade!

Is there anything that can be done to make this happen without using the awkward work around I mentioned in the original question?

Thanks,

infrazee
infrazee  Monday, August 10, 2009 9:00 PM
There's a way you can modify the MSI file after it's built, at ther end here:
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/4ceda905-84c9-42f4-b9b3-2137453fb598/
Phil Wilson
  • Marked As Answer byinfrazee Tuesday, August 11, 2009 5:00 PM
  •  
PhilWilson  Monday, August 10, 2009 9:44 PM

You can use google to search for other answers

Custom Search

More Threads

• How to get values from canned setup dialogs - and what to do with them?
• Multiple App.config files with ClickOnce
• RE: Sample code for a MSI installer
• Deploying a ClickOnce App to Profiles stored on a server
• Help! How can I make it check for updates? (MSI, non ClickOnce)
• How does Installers.Add work?
• Click Once Deployment for PDA
• System.Deployment.Application missing! (VS2005 Beta 2)
• Disable right Click on ActiveX Control in C#
• ClickOnce error while starting setup