You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
overwrite several properties analogous to the ANT task
It’s possible to overwrite the properties 'jar', 'outfile', 'fileVersion', 'txtFileVersion', 'productVersion', 'txtProductVersion'
Example:
<configuration>
<infile>${project.build.sourceDir}/launch4j-config.xml</infile>
<jar>${project.build.directory}/${my.finalJarName}.jar</jar>
<outfile>${project.build.directory}/${my.finalShortName}.exe</outfile>
<versionInfo>
<fileVersion>${my.versionNumber.withBuildId}</fileVersion>
<txtFileVersion>${my.versionNumber}</txtFileVersion>
<productVersion>${my.versionNumber.withBuildId}</productVersion>
<txtProductVersion>${my.versionNumber}</txtProductVersion>
</versionInfo>
</configuration>
For ANT task analogy see https://sourceforge.net/p/launch4j/git/ci/master/tree/src/net/sf/launch4j/ant/Launch4jTask.java#l84
if (outfile != null && !outfile.getAbsolutePath().equals(outFileDefaultValue.getAbsolutePath())) {
321
+
// only overwrite when != defaultValue (should be != null anytime because of the default value)
322
+
getLog().debug("Overwriting config file property 'outfile' (='"+c.getOutfile().getAbsolutePath()+"') with local value '"+outfile.getAbsolutePath()+"'");
323
+
c.setOutfile(outfile);
324
+
}
325
+
326
+
if (versionInfo != null) {
327
+
if (versionInfo.fileVersion != null) {
328
+
getLog().debug("Overwriting config file property 'versionInfo.fileVersion' (='"+c.getVersionInfo().getFileVersion()+"') with local value '"+versionInfo.fileVersion+"'");
getLog().debug("Overwriting config file property 'versionInfo.txtFileVersion' (='"+c.getVersionInfo().getTxtFileVersion()+"') with local value '"+versionInfo.txtFileVersion+"'");
getLog().debug("Overwriting config file property 'versionInfo.productVersion' (='"+c.getVersionInfo().getProductVersion()+"') with local value '"+versionInfo.productVersion+"'");
getLog().debug("Overwriting config file property 'versionInfo.txtProductVersion' (='"+c.getVersionInfo().getTxtProductVersion()+"') with local value '"+versionInfo.txtProductVersion+"'");
0 commit comments