[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $_configCandidates = @( (Join-Path $PSScriptRoot "..\..\cmake-build-debug\config.ini"), (Join-Path $PSScriptRoot "..\..\config.ini"), (Join-Path $PSScriptRoot "..\config.ini"), (Join-Path $PSScriptRoot "config.ini") ) $_configPath = $null foreach ($_c in $_configCandidates) { $_resolved = [System.IO.Path]::GetFullPath($_c) if (Test-Path $_resolved) { $_configPath = $_resolved; break } } if (-not $_configPath) { Write-Host "ERROR: config.ini not found" -ForegroundColor Red; exit 1 } $_configArg = @("--config", $_configPath) Write-Host "Config: $_configPath" -ForegroundColor Gray $_pythonExe = $null foreach ($_cmd in (Get-Command python, python3, py -ErrorAction SilentlyContinue)) { if ($_cmd.Source -notlike "*WindowsApps*") { $_pythonExe = $_cmd.Source; break } } if (-not $_pythonExe) { $_pythonExe = (Get-ChildItem "$env:LOCALAPPDATA\Programs\Python\*\python.exe", "C:\Users\*\AppData\Local\Programs\Python\*\python.exe", "C:\Program Files\Python*\python.exe", "C:\Python*\python.exe" -ErrorAction SilentlyContinue | Select-Object -First 1).FullName } if (-not $_pythonExe) { Write-Host "ERROR: python not found. Install Python or add it to PATH." -ForegroundColor Red; exit 1 } Write-Host "Python: $_pythonExe" -ForegroundColor Gray & $_pythonExe "$PSScriptRoot\gen_fetch_transactions.py" @_configArg @args