fix(installer): configure_embed saute pip si deps deja embarquees (install offline)
Quand l'embed est livre complet (socketio + tkinter pre-embarques), le bootstrap get-pip.py + pip install echouait hors-ligne. Ajout d'un guard : si 'import socketio, tkinter' OK -> on saute pip (offline). Mode online legacy conserve si embed nu. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,23 +40,32 @@ if ($PthFile) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# 2. Installer pip (bootstrap via get-pip.py)
|
# 2-3. Dependances Python
|
||||||
|
# Si l'embed est livre complet (deps + tkinter pre-embarques),
|
||||||
|
# on saute le bootstrap pip / install : INSTALL HORS-LIGNE possible.
|
||||||
|
# Sinon (embed nu), on bootstrap pip + installe requirements (mode online).
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
$GetPip = Join-Path $env:TEMP "get-pip.py"
|
$DepsOk = $false
|
||||||
Write-Host " Telechargement de get-pip.py..."
|
& $PythonExe -c "import socketio, tkinter" 2>$null
|
||||||
Invoke-WebRequest -Uri "https://bootstrap.pypa.io/get-pip.py" -OutFile $GetPip -UseBasicParsing
|
if ($LASTEXITCODE -eq 0) { $DepsOk = $true }
|
||||||
|
|
||||||
Write-Host " Installation de pip..."
|
if ($DepsOk) {
|
||||||
& $PythonExe $GetPip --no-warn-script-location
|
Write-Host " Dependances deja embarquees (socketio + tkinter) - pip saute (offline OK)."
|
||||||
Remove-Item $GetPip -Force
|
} else {
|
||||||
|
# Bootstrap pip (necessite internet)
|
||||||
|
$GetPip = Join-Path $env:TEMP "get-pip.py"
|
||||||
|
Write-Host " Telechargement de get-pip.py..."
|
||||||
|
Invoke-WebRequest -Uri "https://bootstrap.pypa.io/get-pip.py" -OutFile $GetPip -UseBasicParsing
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
Write-Host " Installation de pip..."
|
||||||
# 3. Installer les dependances
|
& $PythonExe $GetPip --no-warn-script-location
|
||||||
# ---------------------------------------------------------------
|
Remove-Item $GetPip -Force
|
||||||
$Requirements = Join-Path $AppDir "requirements_agent.txt"
|
|
||||||
if (Test-Path $Requirements) {
|
$Requirements = Join-Path $AppDir "requirements_agent.txt"
|
||||||
Write-Host " Installation des dependances Python..."
|
if (Test-Path $Requirements) {
|
||||||
& $PythonExe -m pip install --no-warn-script-location -r $Requirements
|
Write-Host " Installation des dependances Python..."
|
||||||
|
& $PythonExe -m pip install --no-warn-script-location -r $Requirements
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user