# Installiert Qt 6.8 (MSVC 2022) + CMake + Ninja fuer den Samplechopper-Port. $ErrorActionPreference = 'Continue' $ProgressPreference = 'SilentlyContinue' $root = 'C:\Users\Key & Co\Desktop\Programme\Samplechopper' $log = Join-Path $root '_setup\qt_setup.log' New-Item -ItemType Directory -Force -Path (Split-Path $log) | Out-Null Set-Content -Path $log -Value "=== Qt setup start $(Get-Date -Format s) ===" function L([string]$m) { $m | Tee-Object -FilePath $log -Append } # --- 1. pip-Werkzeuge ------------------------------------------------------- L "--- pip install aqtinstall cmake ninja ---" & python -m pip install --upgrade --disable-pip-version-check aqtinstall cmake ninja 2>&1 | Tee-Object -FilePath $log -Append L "pip exit: $LASTEXITCODE" if ($LASTEXITCODE -ne 0) { L "FATAL: pip install fehlgeschlagen"; exit 1 } # --- 2. Zielverzeichnis ----------------------------------------------------- $qtDir = 'C:\Qt' try { New-Item -ItemType Directory -Force -Path $qtDir -ErrorAction Stop | Out-Null Test-Path $qtDir -PathType Container -ErrorAction Stop | Out-Null } catch { $qtDir = Join-Path $env:LOCALAPPDATA 'Qt' New-Item -ItemType Directory -Force -Path $qtDir | Out-Null } L "Qt-Zielverzeichnis: $qtDir" # --- 3. Verfuegbare 6.8er-Version bestimmen --------------------------------- L "--- aqt list-qt (6.8) ---" $ver = (& python -m aqt list-qt windows desktop --latest-version 6.8 2>&1 | Select-Object -Last 1) $ver = "$ver".Trim() if (-not $ver -or $ver -notmatch '^6\.') { $ver = '6.8.3' } L "Qt-Version: $ver" # --- 4. Qt installieren ----------------------------------------------------- L "--- aqt install-qt $ver win64_msvc2022_64 (qtbase qttools) ---" & python -m aqt install-qt windows desktop $ver win64_msvc2022_64 ` --outputdir $qtDir --archives qtbase qttools 2>&1 | Tee-Object -FilePath $log -Append $rc = $LASTEXITCODE L "aqt exit (archives): $rc" if ($rc -ne 0) { L "--- Fallback: vollstaendige Basis-Archive ---" & python -m aqt install-qt windows desktop $ver win64_msvc2022_64 ` --outputdir $qtDir 2>&1 | Tee-Object -FilePath $log -Append L "aqt exit (full): $LASTEXITCODE" } # --- 5. Ergebnis pruefen ---------------------------------------------------- L "--- Ergebnis ---" Get-ChildItem -Path $qtDir -Recurse -Filter 'Qt6Config.cmake' -ErrorAction SilentlyContinue | ForEach-Object { L ("Qt6Config: " + $_.FullName) } Get-ChildItem -Path $qtDir -Recurse -Filter 'Qt6Widgets.dll' -ErrorAction SilentlyContinue | ForEach-Object { L ("Qt6Widgets: " + $_.FullName) } foreach ($t in 'cmake', 'ninja') { $p = Get-Command $t -ErrorAction SilentlyContinue if ($p) { L "$t -> $($p.Source)" } else { L "$t -> FEHLT" } } L "=== Qt setup done $(Get-Date -Format s) ==="