Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing values from Java to nsis script

Tags:

java

nsis

I have a java code, where I give some variable dynamically. I need to pass that value to the nsis script. For example I will get a value of the variable age at runtime, and pass it to the var of the nsis script. Is it possible. Any suggestions...

like image 518
Manikandan Avatar asked Feb 28 '26 04:02

Manikandan


2 Answers

The way I pass data to the NSIS script is with ant. When you build your installer you can place tokens in the NSI file and replace them. example using @product.name@ in the NSI file.:

  <replace file="${release.dir}/installer.nsi" token="@product.name@" value="${product.name}"/>
like image 122
sproketboy Avatar answered Mar 02 '26 18:03

sproketboy


You can read environment variables in NSIS files like this:

$%envVarName%

In addition, the ant task allows to set symbols directly:

<nsis script="myproject.nsi" verbosity="4" out="build.log" noconfig="yes">
    <define name="VERSION" value="2.1"/>
</nsis>
like image 38
Daniel Avatar answered Mar 02 '26 17:03

Daniel