# Genera el .zip transportable: instalador + wheel + huellas. param([string]$Salida = "runtime") $ErrorActionPreference = "Stop" $raiz = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path) $version = (Select-String -Path (Join-Path $raiz "pyproject.toml") -Pattern '^version = "(.+)"').Matches[0].Groups[1].Value $bundle = Join-Path $raiz "$Salida\windows-bundle" Remove-Item -LiteralPath $bundle -Recurse -Force -ErrorAction SilentlyContinue New-Item -ItemType Directory -Path (Join-Path $bundle "payload") -Force | Out-Null Push-Location $raiz python -m pip install --quiet build python -m build --wheel --outdir (Join-Path $raiz "dist") Pop-Location $wheel = Get-ChildItem (Join-Path $raiz "dist") -Filter "lexia-$version-*.whl" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 Copy-Item $wheel.FullName (Join-Path $bundle "payload") Copy-Item (Join-Path $raiz "installer\*") $bundle Get-ChildItem -LiteralPath (Join-Path $bundle "payload") -File | ForEach-Object { "$((Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower()) $($_.Name)" } | Set-Content (Join-Path $bundle "SHA256SUMS.txt") $zip = Join-Path $raiz "$Salida\LexIA-Windows-$version.zip" Remove-Item -LiteralPath $zip -Force -ErrorAction SilentlyContinue Compress-Archive -Path (Join-Path $bundle "*") -DestinationPath $zip Write-Host "Paquete listo: $zip"