title: In a Visual Studio setup project, How do I generate an uninstall script?
body: <p>I have a Visual Studio setup project. 
  Upon installation, it creates an uninstall batch file in the application folder.  IF the user wants to uninstall the product, he can go to "Add/Remove Programs", or he can just double-click the uninstall.cmd.  The contents are: </p>
  
  <pre><code>%windir%\system32\msiexec /x {CC3EB7BF-DD82-48B9-8EC5-1B0B62B6D285}
  </code></pre>
  
  <p>The GUID there is the ProductCode from the Setup Project in Visual Studio. </p>
  
  <p><img src="https://i.stack.imgur.com/usjSJ.png" alt="ProductCode"></p>
  
  <p>But, in order for upgrades to work properly, I have to increment the Version number, every time I produce a new MSI.  And, if I increment the Version number, then I also have to generate a new Guid for the ProductCode.  Which means the static uninstall.cmd file needs to change.  </p>
  
  <p>How can I dynamically generate a batch file that contains the ProductCode for the, at build time?  </p>