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