![]() |
#1 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
read json without nsjson
can we read a JSON file in NSIS without using nsjson plugin?
|
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
NSIS does not have native JSON support, you are stuck with the plug-in.
If the file is really small and simple you might be able to use the NSIS file and string instructions but I don't really recommend it. IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
I am sorry for the basic questions. I have this in my json file
{ "BLD_BRH" : "****", "RLS_STR" : "****", "RLS_FIXED" : } i am setting this nsJSON::Set /file $EXEDIR\manifest.json . but I just need to read BLD_BRH and RLS_FIXED. I don't see anything here in examples |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
will check this out..... thank you
|
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
I don't want to write anything. there is already a file that I just need to read.
{ "BLD_BRH" : "****", "RLS_STR" : "****", "RLS_DFT" : [ [ ], ], "RLS_FIXED" :"***", } Section ClearErrors Push $0 nsJSON::Set /file "$EXEDIR\eg.json" nsJSON::Get "RLS_STR" /end Pop $0 MessageBox mb_ok $0 SectionEnd it shows blank |
![]() |
![]() |
![]() |
#7 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
trailing commas are not allowed in JSON
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#8 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
even without that, no difference. it is the same blank message
|
![]() |
![]() |
![]() |
#9 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,484
|
There is known bug in this plug-in, it does not support empty arrays.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Oct 2020
Posts: 44
|
my actual file is not empty... it looks like i have to use file and string instructions
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|