I have a VS 2008 Setup project. I only want to install an XML file if it does not already exist on the target system. The installer overwrite rules for non versioned files ensure that a file will never be overwritten if it has not been modified on the target system. But I want to never overwrite the file. There is a Condition property that can be set on a file in the Visual Studio installer properties for a file. What is the correct syntax for the Condition property to check for existence of file and only install if it is not there?
Visual-studio – Visual Studio Setup Project – conditionally install file
installationsetup-projectvisual studio
Related Topic
- Visual-studio – How to add an existing directory tree to a project in Visual Studio
- Git – .gitignore for Visual Studio Projects and Solutions
- Visual-studio – Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio
- .net – How to fix the Visual Studio compile error, “mismatch between processor architecture”
- Visual-studio – Can you force Visual Studio to always run as an Administrator in Windows 8
- Asp.net-mvc – Visual Studio debugging/loading very slow
Best Answer
You will need to go to the Launch Conditions tab and search the target computer for the file you want to check for. The launch condition will let you specify the name of a property it will set to the path of the file if it exists, otherwise it will be empty. You can now use this property as the condition on your file.