How to force the deployment project to update files during installation of a newer version?

I have a deployment project for my VS2008 C # application. When installing a new version of my application, I want to make sure that the files are updated with the files contained in the installer.

I want my installer to automatically uninstall any old version of the installed application. To do this, I follow this procedure (also described here ):

  • Set RemovePreviousVersions to True
  • Set DetectNewerInstalledVersion to True
  • Installer version increment
  • Select Yes to Change ProductCode

For assembly, I make sure AssemblyVersion has a higher version:

[assembly: AssemblyVersion("1.0.*")]

Everything works as intended, with the exception of configuration files (xml files). Since I cannot find a way to “version” these files, I cannot be sure that the files are updated if they were changed on the target machine.

Is there any way to do this and how?

UPDATE: I tried to find an approach / solution / workaround here

  • Include the file directly in the project with the following properties: "Build Action → Content file" and "Copy to output directory -> Always copy"
  • Then add it to the deployment project through the project Output-> Database-> Content Files

Unfortunately, this did not matter. The behavior is exactly the same.

+3
4

Orca ( , , ), RemoveFile.

. MSDN - . http://msdn.microsoft.com/en-us/library/aa371201.aspx

bootstrapper, "msiexec/i REINSTALLMODE = oums" ( , ). setup.exe, ...

InstallShield - VS2010 IS, , vdproj.

+2

MSI : REINSTALLMODE amus

. , MSI ( ) , .

+3

// , ?

  • : "Build Action → Content "" - > "
  • Output- > Database- > Content Files
+1

, , !

, , ; , ... , / .

, , ( , -).


In addition, I know that sometimes the developer can be the person involved in the deployment. In this case, this behavior may not seem so logical when deploying one site on one server; but when the roles are divided and / or you have several servers with different configurations, it can be a life saver.

0
source

Source: https://habr.com/ru/post/1772480/


All Articles