|
|
#1 |
|
Junior Member
Join Date: Sep 2012
Posts: 43
|
How can i parse property file in NSIS ?
I have a .property file in my Java project. In that property file have more than 20 values. Now I want to parse that property file and change the specific property value at run time(that is when run the install file).
My requirements: 1.I need to give value for SERVER.URL property at run time (while installing the exe file)? 2.How parse property file in java? |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,841
|
Assuming it's a plaintext file, you can use the textfunc.nsh macros detailed in Appendix E of the manual. For example ConfigRead: http://nsis.sourceforge.net/Docs/AppendixE.html#E.2.9
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2012
Posts: 43
|
@MSG Thanks.ya.you are correct.In that case i have more than one value need to read and parse it.How its possible? and also If i use ${configread} values can be hard coded.I dont like this.I need to give input value at run time while installing the exe file only.correctly i have tried this,
${ConfigWrite} "C:\resource\conf.properties" "WEBSERVICE.URL" "=http://localhost:8080" $0 I need to give this http://localhost:8080 value at run time? |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,841
|
Parameters to ConfigWrite do not need to be hardcoded, you can use a variable as the parameter.
If there are multiple occurrences of a certain configuration entry, you'll probably have to parse the file manually with LineFind etc. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2012
Posts: 43
|
@ MSG thanks.Is it possible to pass values in dynamically?(ie without hard code values).can you explain me more or share any link?
yes.i want to pass more than one value.so i think need to use LineFind.If you know any example or tutorial please share to me.Its really help for me Thanks |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,841
|
LineFind examples in the manual. Pass dynamic values simply by putting a $variable as parameter, and giving the variable a value at runtime.
|
|
|
|
![]() |
|
|||||||
| Tags |
| java, nsis |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|