1

In my Inno setup project, I need to parse a JSON. I Try to create a dll and parse JSON with the dll function but it gives me an access violation error after two days I could not find the reason for this access violation so I decide to parse JSON inside the Inno Setup. I want to parse this JSON and Use the JsonParser library also here is two similar Questions but I couldn't get it.

How to parse a JSON string in Inno Setup?

JSON arrays in inno setup

{
 "Header":"Install FileType",

 "Files":  
 [
   {
    "Filename":"SQL Server",
    "FileType": 1,
    "CheckExists":true,    
  },
  {
    "Filename":"Dot Net 3.5",
    "FileType": 2,
    "CheckExists":false,  
  }

 ]
}

I need this function

type
 TJFile = record 
   FileName : string;
   FileType : Integer;
   CheckExists: Boolean;

GetFile(JSON: string; Index :Integer; var File: TJFile );

how can parse Json to get File with its index. Thank you for help and guid me.

sina
  • 331
  • 4
  • 12

1 Answers1

0

I don't know Pascal Script, so I cannot really answer your question, but I notice that your JSON sample is not valid: there shouldn't be a comma after "true" (line 9), neither after "false" (line 14).