title: How do I set the TARGETDIR programmatically?
body: <p>I am creating an MSI package for my application. The requirement is such that if application <code>A</code> is installed at client machine, this new set up should install in that application folder. Otherwise it should create its own folder.</p>
  
  <p>I have created custom installer. I have overridden the methods like <code>OnInstall</code>, <code>OnBeforeInstall</code>, etc. But no effect on <code>TARGETDIR</code>.</p>
  
  <p>Even though I write this:</p>
  
  <pre><code>this.Context.Parameters["TARGETDIR"] = new_path;
  </code></pre>
  
  <p>It still installs it to old path which is set as <code>DefaultLocation</code> property of <code>ApplicationFolder</code> Tab of setup project.</p>
  
  <p>How do I resolve this?</p>