Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 19th September 2012, 11:34   #1
ilaiyaraja
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?
ilaiyaraja is offline   Reply With Quote
Old 19th September 2012, 13:13   #2
MSG
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
MSG is offline   Reply With Quote
Old 19th September 2012, 13:31   #3
ilaiyaraja
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?
ilaiyaraja is offline   Reply With Quote
Old 19th September 2012, 19:44   #4
MSG
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.
MSG is offline   Reply With Quote
Old 20th September 2012, 07:32   #5
ilaiyaraja
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
ilaiyaraja is offline   Reply With Quote
Old 20th September 2012, 10:39   #6
MSG
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.
MSG is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Tags
java, nsis

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump