Archive: How can i parse property file in NSIS ?


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?


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


@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?


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.


@ 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


LineFind examples in the manual. Pass dynamic values simply by putting a $variable as parameter, and giving the variable a value at runtime.