@@ -184,6 +184,69 @@ function Download-And-Verify-Asset([string]$baseUrl, [string]$asset, [string]$tm
184184 return $archivePath
185185}
186186
187+ function Install-SqliteDll ([string ]$installBin , [string ]$tmpDir ) {
188+ $sqliteDll = Join-Path $installBin " sqlite3.dll"
189+
190+ if (Test-Path - LiteralPath $sqliteDll ) {
191+ Info " sqlite3.dll already exists"
192+ return
193+ }
194+
195+ $archRaw = $env: PROCESSOR_ARCHITECTURE
196+
197+ switch - Regex ($archRaw ) {
198+ " AMD64" {
199+ $sqliteAsset = " sqlite-dll-win-x64-3530200.zip"
200+ }
201+ " ^ARM" {
202+ $sqliteAsset = " sqlite-dll-win-arm64-3530200.zip"
203+ }
204+ " x86" {
205+ $sqliteAsset = " sqlite-dll-win-x86-3530200.zip"
206+ }
207+ default {
208+ Warn " unsupported SQLite architecture: $archRaw "
209+ return
210+ }
211+ }
212+
213+ $sqliteUrl = " https://www.sqlite.org/2026/$sqliteAsset "
214+ $sqliteDir = Join-Path $tmpDir " sqlite"
215+ $sqliteZip = Join-Path $sqliteDir $sqliteAsset
216+
217+ New-Item - ItemType Directory - Force - Path $sqliteDir | Out-Null
218+ New-Item - ItemType Directory - Force - Path $installBin | Out-Null
219+
220+ Info " downloading SQLite runtime $sqliteAsset "
221+
222+ try {
223+ Invoke-WebRequest - Uri $sqliteUrl - OutFile $sqliteZip
224+ } catch {
225+ Die " could not download SQLite runtime: $sqliteUrl "
226+ }
227+
228+ try {
229+ Expand-Archive - LiteralPath $sqliteZip - DestinationPath $sqliteDir - Force
230+ } catch {
231+ Die " could not extract SQLite runtime"
232+ }
233+
234+ $dllCandidate = Get-ChildItem - LiteralPath $sqliteDir - Recurse - File - Filter " sqlite3.dll" |
235+ Select-Object - First 1
236+
237+ if (-not $dllCandidate ) {
238+ Die " SQLite archive does not contain sqlite3.dll"
239+ }
240+
241+ Copy-Item - LiteralPath $dllCandidate.FullName - Destination $sqliteDll - Force
242+
243+ if (-not (Test-Path - LiteralPath $sqliteDll )) {
244+ Die " sqlite3.dll was not installed to $sqliteDll "
245+ }
246+
247+ Ok " installed sqlite3.dll"
248+ }
249+
187250function Add-To-UserPath ([string ]$pathToAdd ) {
188251 $userPath = [Environment ]::GetEnvironmentVariable(" Path" , " User" )
189252
@@ -315,12 +378,14 @@ try {
315378
316379 $ArchivePath = Download- And- Verify- Asset $BaseUrl $Asset $TmpDir
317380
318- if ($InstallKind.ToLowerInvariant () -eq " cli" ) {
381+ if ($InstallKind.ToLowerInvariant () -eq " cli" ) {
319382 $Exe = Install-Cli $ArchivePath $TmpDir
320383 } else {
321384 $Exe = Install-Sdk $ArchivePath $TmpDir
322385 }
323386
387+ Install-SqliteDll $BinDir $TmpDir
388+
324389 $PathAlreadyReady = Add-To - UserPath $BinDir
325390
326391 try {
0 commit comments