1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
| @echo off
cls
mode con LINES=40 COLS=100
setlocal enabledelayedexpansion
set currentpath=%~dp0
set chemin=%currentpath%
set donnees=%chemin%Parametres.txt
Rem -------------------------------------------------------------------
Rem INITIALISATION COLOR
Rem -------------------------------------------------------------------
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
Rem -------------------------------------------------------------------
Rem FIN INITIALISATION COLOR
Rem -------------------------------------------------------------------
call :colorEcho 0e " Installation Pack Logiciels"
@echo.
call :colorEcho 07 "------------------------------------------------------------------"
@echo.
call :colorEcho 0b " VERSION INSTALLEE VERSION "
@echo.
call :colorEcho 07 "------------------------------------------------------------------"
@echo.
call :INSTALL "firefox.exe" Firefox
call :INSTALL "soffice.exe" LibreOffice
call :INSTALL "AcroRd32.exe" Adobe_Reader
call :INSTALL "java.exe" Java
call :INSTALL "7zFM.exe" 7Zip
call :INSTALL "ganttproject.exe" Gantt
call :INSTALL "XMind.exe" XMind
call :INSTALL gimp*.exe Gimp
call :INSTALL "inkscape.exe" inkscape
call :INSTALL "Scribus.exe" scribus
@echo.
call :colorEcho 0E " Fin de l'installation du Pack Logiciels"
@echo.
pause
exit
Rem *******************************************************************
Rem MODULE TEST VERSION
Rem *******************************************************************
Rem -------------------------------------------------------------------
Rem Test Installation Logiciels
Rem -------------------------------------------------------------------
:INSTALL
set FILEPATH=
set VERS=
set OVERS=
for /F "tokens=*" %%a in ('findstr /i %~2 %donnees%') do set VERS=%%a
for /f "delims=" %%A in ('2^>nul dir /a-d /b /s "%ProgramFiles(x86)%\%~1"') do set "FILEPATH=%%A"
for /f "delims=" %%A in ('2^>nul dir /a-d /b /s "%ProgramFiles%\%~1"') do set "FILEPATH=%%A"
for /f "tokens=*" %%a in ('powershell "(gi '%FILEPATH%').versioninfo.Fileversion"') do set OVERS=%%a
Rem -------------------------------------------------------------------
Rem Supprime caracteres , et remplace par . de la chaine
Rem -------------------------------------------------------------------
set Chaine1=%OVERS%
set OVERS=%Chaine1:, =.%
set Chaine1=%OVERS%
set OVERS=%Chaine1:,=.%
Rem -------------------------------------------------------------------
Rem Cherche la longueur de la chaine
Rem -------------------------------------------------------------------
SET "a=%2 %OVERS%"
SET longueur=0
:loop
IF "%a%"=="" GOTO endloop
SET a=%a:~0,-1%
SET /A longueur=%longueur%+1
GOTO loop
:endloop
SET "b= NON INSTALLE%"
set "c=!b:~%longueur%!"
SET "d= A JOUR%"
set "e=!d:~%longueur%!"
SET "f= A INSTALLER = %"
set "g=!f:~%longueur%!"
IF "%FILEPATH%"=="" (
call :colorEcho 07 " %2 "
call :colorEcho 0d "%c%"
echo.
set /p chinst= Voulez-vous installer l'application %2 ? [O/N]:
if /i "%chinst%" EQU "o" call :%2
exit /b 1
)
if "%2 %OVERS%" EQU "%VERS%" ( call :colorEcho 07 " %VERS%"
call :colorEcho 02 "%e%"
@echo.
) else (call :colorEcho 07 " %2 %OVERS%"
call :colorEcho 07 "%g% "
call :colorEcho 0c " %VERS%"
@echo.
call :%2
)
goto :eof
Rem *******************************************************************
Rem Module installation LOGICIELS
Rem *******************************************************************
:firefox
Rem ------------------------------FIREFOX------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%Firefox*32.exe") do set FF32=%%a
for %%a in ("%chemlog%Firefox*64.exe") do set FF64=%%a
rem call %FF32% -ms"
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:Libreoffice
Rem ------------------------------LIBREOFFICE--------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%LibreOffice*x86.msi") do set LO32="%%a"
for %%a in ("%chemlog%LibreOffice*x86_helppack_fr.msi") do set LOH32="%%a"
for %%a in ("%chemlog%Grammalecte-fr*.oxt") do set LOHCOR="%%a"
rem call msiexec /i %LO32% /qn
rem call msiexec /i %LOH32% /qn
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL---------------------------
:Adobe_Reader
Rem ------------------------------READER------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%AcroRdrDC*_fr_FR.exe") do set ARDC="%%a"
rem call %ARDC% /sAll
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL---------------------------
:Java
Rem ------------------------------JAVA--------------------------------
call :colorEcho 0E " D‚sinstallation des Verisons JAVA pr‚c‚dentes"
@echo.
rem wmic product where "name like 'Java%%'" call uninstall
call :colorEcho 0a " D‚sinstallation des Versions JAVA ---------- OK"
@echo.
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%jre*i586.exe") do set JAVA32="%%a"
for %%a in ("%chemlog%jre*64.exe") do set JAVA64="%%a"
rem call %JAVA32% /s
rem if %OS%==x64 call %JAVA64% /s
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:7Zip
Rem ------------------------------7Zip---------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%7z2*32.exe") do set z732="%%a"
for %%a in ("%chemlog%7z2*64.exe") do set z764="%%a"
rem if %OS%==x64 (call %z764% /S) else (call %z732% /S)
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:Gantt
Rem ------------------- Gantt -----------------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%ganttproject*.exe") do set GNT="%%a"
rem call %GNT% /S
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:Xmind
Rem ------------------- Xmind -----------------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%xmind*.exe") do set UXM="%%a"
rem call %UXM% /VERYSILENT
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:gimp
Rem ------------------- gimp ------------------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%gimp*.exe") do set APP32="%%a"
rem call %APP32% /VERYSILENT /NORESTART /ALLUSERS
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:inkscape
Rem ------------------- inkscape --------------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%inkscape*64.msi") do set INKSP64="%%a"
for %%a in ("%chemlog%inkscape*86.msi") do set INKSP32="%%a"
rem if %OS%==x64 (call msiexec /i %INKSP64% /qn) else (call msiexec /i %INKSP32% /qn)
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
:scribus
Rem ------------------- scribus ---------------------------------------
call :colorEcho 0b " Patientez mise … jour en cours"
for %%a in ("%chemlog%scribus*x32.exe") do set SCRB32="%%a"
for %%a in ("%chemlog%scribus*x64.exe") do set SCRB64="%%a"
rem if %OS%==x64 (call %SCRB64% /S) else (call %SCRB32% /S)
IF %ERRORLEVEL% EQU 0 (
call :colorEcho 0a " OK"
)
IF %ERRORLEVEL% NEQ 0 (
call :colorEcho 04 " PB"
)
@echo.
goto :eof
Rem ----------------------------FIN INSTALL----------------------------
Rem -------------------------------------------------------------------
Rem Module Color
Rem -------------------------------------------------------------------
:colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i |