Passing in version number to Inno Setup compiler
<p>I want my Inno Setup script to be build using the command line, and I want to pass in the product version number as a parameter. I am trying to implement it like so:</p>

<pre><code>[setup]
VersionInfoVersion={param:version|0.0.0.0}
</code></pre>

<p>However the compiler informs me this is invalid for that directive. I have read <a href="https://stackoverflow.com/questions/3618257/is-it-possible-to-accept-custom-command-line-parameters-with-innosetup">this</a> post on how to pass in custom parameters from the command line and assume I should just be able to pass in something like:</p>

<pre><code>compil32 /cc "c:\isetup\samples\my script.iss" /version=1.0.0.0
</code></pre>

<p>I have also tried the suggestion from <a href="https://stackoverflow.com/questions/6498750/how-do-i-automatically-set-the-version-of-my-inno-setup-installer-according-to-m">this post</a> and tried doing the following:</p>

<pre><code>#define PathToMyBinary "C:\bin\x64\Release"
#define ApplicationVersion GetFileVersion('#PathToMyBinary\MyBinary.dll')

VersionInfoVersion={#ApplicationVersion}
</code></pre>

<p>But it doesn't seem to return anything. Both approaches seem valid to me so I'm hoping someone can explain where I am going wrong. </p>