title: How to use String Replace in NSIS
body: <p>I use maven, I have a maven-project with version X.Y.Z-SNAPSHOT, and I use <a href="http://mojo.codehaus.org/nsis-maven-plugin/" rel="nofollow">maven-nsis-plugin</a>. Because the Version is in format X.Y.Z-SNAPSHOT, I have to remove this suffix and repace it with a 0. </p>
  
  <p>The maven plugin <a href="http://mojo.codehaus.org/nsis-maven-plugin/" rel="nofollow">maven-nsis-plugin</a> generates a project.nsh:</p>
  
  <pre><code>!define PROJECT_VERSION "4.23.9-SNAPSHOT"
  </code></pre>
  
  <p>which is used in my setup.nsi: </p>
  
  <pre><code>!include target\project.nsh
  
  Section VersionReplace
      Push "${PROJECT_VERSION}"
      Push "-SNAPSHOT"
      Push "0"
      Call StrRep
      Pop $0
  
      !define VERSION_SHORT $0
  SectionEnd
  
  Name "Installer ${VERSION_SHORT}"
  
  (...)
  
  VIProductVersion ${VERSION_SHORT}
  </code></pre>
  
  <p><strong>Problem</strong>: In the Console i can see: </p>
  
  <pre><code>Name: "Installer $0"
  (...)
  VIAddVersionKey: "ProductVersion" "$0"
  </code></pre>
  
  <p>so the $0 is not replaced. <strong>What am I doing wrong?</strong></p>
  
  <p>Replacement function used: <a href="http://nsis.sourceforge.net/StrRep" rel="nofollow">StrRep</a> </p>