You already know how to call the online API:
Check an IP address against an online list in Inno Setup
You basically already know even how to parse the JSON, but ok, this is bit specific. With use of JsonParser library and my functions from How to parse a JSON string in Inno Setup?, you can write:
function AllowInstallation(Json: string): Boolean;
var
JsonParser: TJsonParser;
JsonRoot, SecurityObject: TJsonObject;
I: Integer;
begin
Result := True;
Log('Parsing');
if not ParseJsonAndLogErrors(JsonParser, Json) then
begin
Log('Cannot parse, allowing installation');
end
else
begin
Log('Parsed');
JsonRoot := GetJsonRoot(JsonParser.Output);
if not FindJsonObject(JsonParser.Output, JsonRoot, 'security', SecurityObject) then
begin
Log('Cannot find "security", allowing installation');
end
else
begin
for I := 0 to Length(SecurityObject) - 1 do
begin
if SecurityObject[I].Value.Kind <> JVKWord then
begin
Log(Format('"%s" is not "word", ignoring', [SecurityObject[I].Key]));
end
else
if JsonParser.Output.Words[SecurityObject[I].Value.Index] = JWTrue then
begin
Log(Format('"%s" is "true", not allowing the installation', [
SecurityObject[I].Key]));
Result := False;
end
else
begin
Log(Format('"%s" is not "true"', [SecurityObject[I].Key]));
end;
end;
end;
end;
ClearJsonParser(JsonParser);
end;