install.bat — raccourcis recreés dans mise a jour et reparation

- Option 2 (mise a jour) recrée lanceurs + raccourcis Bureau/Menu Demarrer
- Option 3 (reparation) recrée aussi les raccourcis
- Affiche la commande de debug en fin de chaque operation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jules
2026-03-20 12:02:07 +01:00
parent c6195a9a39
commit 7c6e2f26d9

View File

@@ -333,13 +333,42 @@ echo.
echo [2/3] Mise a jour dependances...
"%PYTHON_CMD%" -m pip install --upgrade --no-warn-script-location PyQt6 pypdf reportlab pypdfium2
:: Lanceurs et raccourcis
echo.
echo [3/5] Mise a jour des lanceurs...
(
echo @echo off
echo cd /d "!APP_DIR!"
echo "!PYTHON_CMD!" main.py
echo if errorlevel 1 pause
) > "%INSTALL_DIR%\lancer.bat"
(
echo Set WshShell = CreateObject^("WScript.Shell"^)
echo WshShell.CurrentDirectory = "!APP_DIR!"
echo WshShell.Run """!PYTHON_CMD!"" ""!APP_DIR!\main.py""", 0, False
) > "%INSTALL_DIR%\lancer.vbs"
echo [OK] Lanceurs crees
echo.
echo [4/5] Raccourcis...
set "LOGO_ICO=%APP_DIR%\resources\logo.png"
powershell -Command "$s = (New-Object -COM WScript.Shell).CreateShortcut([Environment]::GetFolderPath('Desktop')+'\%SHORTCUT_NAME%.lnk'); $s.TargetPath='%INSTALL_DIR%\lancer.vbs'; $s.WorkingDirectory='%APP_DIR%'; $s.Description='%APP_NAME%'; $s.Save()"
echo [OK] Raccourci Bureau
powershell -Command "$s = (New-Object -COM WScript.Shell).CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\%SHORTCUT_NAME%.lnk'); $s.TargetPath='%INSTALL_DIR%\lancer.vbs'; $s.WorkingDirectory='%APP_DIR%'; $s.Description='%APP_NAME%'; $s.Save()"
echo [OK] Raccourci Menu Demarrer
:: Test
echo.
echo [3/3] Test...
echo [5/5] Test...
"%PYTHON_CMD%" -c "import sys; sys.path.insert(0, r'%APP_DIR%'); from app.engine.pdf_utils import PAGE_SIZES; print(' [OK] Moteur PDF charge')"
if %ERRORLEVEL% neq 0 (
echo [ERREUR] Probleme detecte.
echo "%PYTHON_CMD%" "%APP_DIR%\main.py"
echo Debug : "%PYTHON_CMD%" "%APP_DIR%\main.py"
)
echo.
@@ -347,6 +376,9 @@ echo ============================================================
echo MISE A JOUR TERMINEE
echo ============================================================
echo.
echo Lancer : raccourci Bureau "%SHORTCUT_NAME%"
echo Debug : "%PYTHON_CMD%" "%APP_DIR%\main.py"
echo.
pause
goto MENU
@@ -428,6 +460,13 @@ if exist "%APP_DIR%\main.py" (
echo [OK] Lanceurs mis a jour
)
:: Raccourcis
powershell -Command "$s = (New-Object -COM WScript.Shell).CreateShortcut([Environment]::GetFolderPath('Desktop')+'\%SHORTCUT_NAME%.lnk'); $s.TargetPath='%INSTALL_DIR%\lancer.vbs'; $s.WorkingDirectory='%APP_DIR%'; $s.Description='%APP_NAME%'; $s.Save()"
echo [OK] Raccourci Bureau
powershell -Command "$s = (New-Object -COM WScript.Shell).CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\%SHORTCUT_NAME%.lnk'); $s.TargetPath='%INSTALL_DIR%\lancer.vbs'; $s.WorkingDirectory='%APP_DIR%'; $s.Description='%APP_NAME%'; $s.Save()"
echo [OK] Raccourci Menu Demarrer
rmdir /s /q "%INSTALL_DIR%\temp" 2>nul
echo.
@@ -436,6 +475,7 @@ echo REPARATION TERMINEE
echo ============================================================
echo.
echo Python : %PYTHON_CMD%
echo Lancer : raccourci Bureau "%SHORTCUT_NAME%"
echo Debug : "%PYTHON_CMD%" "%APP_DIR%\main.py"
echo.
pause