Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is an old post but adding this for people who might come looking for an answer.</p> <p>I ran into this very problem even after following everything given <a href="https://stackoverflow.com/questions/3024753/installing-a-new-version-of-a-deployment-project-over-old-version">here</a> to the letter. My issue was that the C# program's version will not increment on every build no matter what. Even after I manually edited AssemblyInfo.cs, the generated exe's version would still be 1.0.0.0. As a result, setup won't replace the file. </p> <p>The workaround is to add a launch condition to the "Primary Output from XYZ Project" (or whatever you want to be overwritten) node of setup project. This causes the installer to delete the file when the newer setup is run. Now when user launches the app, a window appears saying application is being configured, newer files are copied to the app folder and app is launched. This is plain trial and error. I have no clue why it works this way (and I need some coffee after spending the whole night trying to figure this out :)).</p> <ol> <li>Right click on your setup project >> View >> Launch Conditions</li> <li>Right click on "Requirements on Target Machine" >> Add File Launch Condition</li> <li>A node ("Search for File1") will appear under "Search Target Machine" and another node ("Condition1") will appear under "Launch Conditions"</li> <li>Click on Search for File1 and change its FileName property to something which is bound to pre-exist (like "Notepad.exe", well almost always)</li> <li>Note that "Folder" is set to "[SystemFolder]" and "Property" is set to "FILEEXISTS1"</li> <li>Now click on Primary Output from XYZ Project or any other node and in the properties window, set "Condition" to "FILEEXISTS1" exactly as it appeared above</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload