04-01-2026, 06:02 AM
LA uses the .NET `HttpClient` with default settings. On my test Windows 7 it works. Changing the security protocol type is possible, but not recommended. On that rare computers where fails, it's better to show a dialog with "download manually" instructions.
LA uses this code. You can try it in a script.
With changed security protocol it would be
LA uses this code. You can try it in a script.
//Get the download URL of the last sqlite version for this OS. This way is documented in https://www.sqlite.org/download.html.
var html = internet.http.Get("https://www.sqlite.org/download.html").Text();
//print.it(html);
if (!html.RxMatch(@"(?s)<!-- Download product data for scripts to read\s+(.+)\s+-->", 1, out string csv)) throw new AuException();
//print.it(csv);
var x = csvTable.parse(csv);
string s = $"sqlite-dll-win-{RuntimeInformation.ProcessArchitecture.ToString().Lower()}";
string url = x.Rows.First(o => o[2].Contains(s, StringComparison.OrdinalIgnoreCase))[2];
url = "https://www.sqlite.org/" + url;
print.it(url);
//Download the zip.
var bytes = internet.http.Get(url).Bytes();
print.it($"OK, size={bytes.Length}");With changed security protocol it would be
using System.Net.Http;
using System.Net;
using var handler = new SocketsHttpHandler {
SslOptions =
{
EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12,
},
AutomaticDecompression = DecompressionMethods.All
};
using var http = new HttpClient(handler);
http.DefaultRequestHeaders.Add("User-Agent", "Au");
//Get the download URL of the last sqlite version for this OS. This way is documented in https://www.sqlite.org/download.html.
var html = http.Get("https://www.sqlite.org/download.html").Text();
//print.it(html);
if (!html.RxMatch(@"(?s)<!-- Download product data for scripts to read\s+(.+)\s+-->", 1, out string csv)) throw new AuException();
//print.it(csv);
var x = csvTable.parse(csv);
string s = $"sqlite-dll-win-{RuntimeInformation.ProcessArchitecture.ToString().Lower()}";
string url = x.Rows.First(o => o[2].Contains(s, StringComparison.OrdinalIgnoreCase))[2];
url = "https://www.sqlite.org/" + url;
print.it(url);
//Download the zip.
var bytes = http.Get(url).Bytes();
print.it($"OK, size={bytes.Length}");
about QM3 Some suggestions