- Panneau de fusion PDF avec dialog dedié : - Liste des fichiers avec drag & drop pour reordonner - Boutons Ajouter/Retirer/Monter/Descendre - Pre-rempli avec le fichier courant - Support --macro en ligne de commande - register_windows.bat : ajout dynamique des macros au menu contextuel - Vision : bouton "Configurer le client" dans le modal licence (ouvre le gros modal client avec SFTP, fonctions, tunnel, etc.) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
116 lines
4.7 KiB
Batchfile
116 lines
4.7 KiB
Batchfile
@echo off
|
|
chcp 65001 >nul 2>&1
|
|
echo ============================================================
|
|
echo CopyDev Imposing Tool — Enregistrement Windows
|
|
echo ============================================================
|
|
echo.
|
|
|
|
:: Trouver l'exe
|
|
set "EXE_PATH=%~dp0CopydevImposingTool.exe"
|
|
if not exist "%EXE_PATH%" (
|
|
set "EXE_PATH=%~dp0dist\CopydevImposingTool.exe"
|
|
)
|
|
if not exist "%EXE_PATH%" (
|
|
echo [ERREUR] CopydevImposingTool.exe introuvable.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
echo Executable : %EXE_PATH%
|
|
echo.
|
|
|
|
echo 1. Associer les fichiers PDF
|
|
echo 2. Ajouter au menu contextuel
|
|
echo 3. Tout enregistrer (1+2)
|
|
echo 4. Tout desenregistrer
|
|
echo 5. Quitter
|
|
echo.
|
|
set /p "CHOIX=Votre choix [1-5] : "
|
|
|
|
if "%CHOIX%"=="1" goto ASSOC
|
|
if "%CHOIX%"=="2" goto CONTEXT
|
|
if "%CHOIX%"=="3" goto ALL
|
|
if "%CHOIX%"=="4" goto UNREGISTER
|
|
if "%CHOIX%"=="5" exit /b 0
|
|
|
|
:ALL
|
|
call :DO_ASSOC
|
|
call :DO_CONTEXT
|
|
goto DONE
|
|
|
|
:ASSOC
|
|
call :DO_ASSOC
|
|
goto DONE
|
|
|
|
:CONTEXT
|
|
call :DO_CONTEXT
|
|
goto DONE
|
|
|
|
:DO_ASSOC
|
|
echo.
|
|
echo [1] Association des fichiers PDF...
|
|
reg add "HKCU\Software\Classes\.pdf\OpenWithProgids" /v "CopyDevImpose" /t REG_SZ /d "" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\CopyDevImpose" /ve /d "CopyDev Imposing Tool" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\CopyDevImpose\shell\open\command" /ve /d "\"%EXE_PATH%\" \"%%1\"" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\CopyDevImpose\DefaultIcon" /ve /d "%EXE_PATH%,0" /f >nul 2>&1
|
|
echo [OK] PDF associe a CopyDev Imposing Tool
|
|
echo (clic droit > Ouvrir avec > CopyDev Imposing Tool)
|
|
goto :EOF
|
|
|
|
:DO_CONTEXT
|
|
echo.
|
|
echo [2] Menu contextuel Windows...
|
|
:: Entree principale
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose" /ve /d "CopyDev Impose" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose" /v "SubCommands" /t REG_SZ /d "" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose" /v "Icon" /t REG_SZ /d "%EXE_PATH%,0" /f >nul 2>&1
|
|
|
|
:: Sous-commandes
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\open" /ve /d "Ouvrir" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\open\command" /ve /d "\"%EXE_PATH%\" \"%%1\"" /f >nul 2>&1
|
|
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\bookletA4" /ve /d "Livret A4" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\bookletA4\command" /ve /d "\"%EXE_PATH%\" --action booklet_a4 \"%%1\"" /f >nul 2>&1
|
|
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\bookletA3" /ve /d "Livret A3" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\bookletA3\command" /ve /d "\"%EXE_PATH%\" --action booklet_a3 \"%%1\"" /f >nul 2>&1
|
|
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\nup2x2" /ve /d "2x2 par feuille" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\nup2x2\command" /ve /d "\"%EXE_PATH%\" --action nup_2x2 \"%%1\"" /f >nul 2>&1
|
|
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\unbooklet" /ve /d "Delivretiser" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\unbooklet\command" /ve /d "\"%EXE_PATH%\" --action unbooklet \"%%1\"" /f >nul 2>&1
|
|
|
|
:: Ajouter les macros enregistrees
|
|
if exist "%~dp0.presets.json" (
|
|
echo Ajout des macros...
|
|
for /f "tokens=1 delims=:" %%m in ('findstr /r "\"[^\"]*\":" "%~dp0.presets.json" ^| findstr /v "{" ^| findstr /v "action" ^| findstr /v "settings"') do (
|
|
set "MACRO=%%~m"
|
|
set "MACRO=!MACRO: =!"
|
|
set "MACRO=!MACRO:"=!"
|
|
if not "!MACRO!"=="" (
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\macro_!MACRO!" /ve /d "Macro: !MACRO!" /f >nul 2>&1
|
|
reg add "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose\shell\macro_!MACRO!\command" /ve /d "\"%EXE_PATH%\" --macro \"!MACRO!\" \"%%1\"" /f >nul 2>&1
|
|
)
|
|
)
|
|
)
|
|
|
|
echo [OK] Menu contextuel ajoute
|
|
echo (clic droit sur PDF > CopyDev Impose > ...)
|
|
goto :EOF
|
|
|
|
:UNREGISTER
|
|
echo.
|
|
echo Suppression des enregistrements...
|
|
reg delete "HKCU\Software\Classes\CopyDevImpose" /f >nul 2>&1
|
|
reg delete "HKCU\Software\Classes\.pdf\OpenWithProgids" /v "CopyDevImpose" /f >nul 2>&1
|
|
reg delete "HKCU\Software\Classes\SystemFileAssociations\.pdf\shell\CopyDevImpose" /f >nul 2>&1
|
|
echo [OK] Tout desenregistre
|
|
goto DONE
|
|
|
|
:DONE
|
|
echo.
|
|
echo ============================================================
|
|
echo Termine
|
|
echo ============================================================
|
|
pause
|