1
votes

I have builded Nsis script successfully.I have bat file in my project.Inside bat file i have two variables with default values as follows

 JVM_DLL=c:\program Files\java\jre\bin\client\jvm.dll

 Home_path=c:\opt\projectName

If the user wants to modify the value for JVM_DLL and Home_path that should be written in batch file.How to do this? I donot know how to write in batch file using Nsis script?

I have tried following codes.but its not working

 StrCpy $JVM_DLL "jre\bin\client\jvm.dll"
 ${ConfigWrite} "$INSTDIR\resource\batch.bat" "JVM_DLL" "=$JVM_DLL" $R0
 ${ConfigWrite} "$INSTDIR\resource\batch.bat" "HOME_PATH" "=$INSTDIR" $R0

thanks

1

1 Answers

0
votes

If you have defined the 2 values in the .bat file that is also launching makensis.exe, use the /D command line switch to define those values for the nsis script.

In your example, given your 2 .bat variables:

makensis.exe /DJVM_DLL=%JVM_DLL% /DHome_path=%Home_path% yourscript.nsi