I am building a setup file with InnoSetup 5.5.6 and I am also using maven to automatically build the installer. Maven is using exec-maven-plugin, so this method is eqvivalent to running iscc.exe on commandline.
What I am basically trying to do is inject a version number as a command line argument, so I can use that version number inside the setup.iss file.
Here is the command line argument (more detail below):
ISCC.exe setup.iss /d"MyAppVersion=1.0.0"
Here is the relevant code snippet from the .iss file. I've been trying with this but it is not working. If I hardcode the version, everything works fine.
[Files]
Source: "..\..\..\target\jars\my-java-project-{#MyAppVersion}.jar"; DestDir: "{app}"; DestName: "my-java-project.jar"; Flags: external
And I would like to evaluate the file as:
my-java-project-1.0.0.jar
Not sure whether it is even possible, but thanks for the help in advance.
(EDIT1)
Thank you everyone who put in effort to resolve this issue.
I think my case is not trivial, and I tried to skip not relevant information, to keep things simple, but I think I should share more info about the build.
When I manually type into cmd the command which is inside exec-maven-plugin
iscc.exe setup.iss /d"VersionText=1.0.0-SNAPSHOT" /d"VersionNumeric=1.0.0" /d"BalanceAgentVersion=1.0.0-SNAPSHOT"
then the jar file still gets omitted from the packaged exe installer.
The relevant maven codes:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>generate-installer</id>
<goals>
<goal>exec</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<executable>${project.basedir}/src/main/resources/issc_executables/ISCC.exe</executable>
<workingDirectory>${project.basedir}/src/main/innosetup/</workingDirectory>
<arguments>
<argument>${project.basedir}/src/main/innosetup/setup.iss</argument>
<argument>/d"VersionText=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-${parsedVersion.qualifier}"</argument>
<argument>/d"VersionNumeric=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</argument>
<argument>/d"MyAppVersion=${my-app.version}"</argument>
</arguments>
</configuration>
maven properties:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<dependency-plugin.version>2.10</dependency-plugin.version>
<my-app.version.version>1.0.0-SNAPSHOT</balance-agent.version>
</properties>