From 7c6e2f26d98fcebbd0ce5cb3f878e5f18fb572a1 Mon Sep 17 00:00:00 2001 From: Jules Date: Fri, 20 Mar 2026 12:02:07 +0100 Subject: [PATCH] =?UTF-8?q?install.bat=20=E2=80=94=20raccourcis=20recre?= =?UTF-8?q?=C3=A9s=20dans=20mise=20a=20jour=20et=20reparation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- install.bat | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/install.bat b/install.bat index 2511564..4c1e84c 100644 --- a/install.bat +++ b/install.bat @@ -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