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
| ECHO **********************************************************************
ECHO **** Installation automatisée par GPO par l'agent FusionInventory ****
ECHO **** A utiliser via une GPO ****
ECHO **********************************************************************
rem **** Indique la version de l'agent
for /f "delims=" %%X in ('type C:\VersionFusionInventory.txt') do (
set VERSIONINSTALEE=%%X
)
set VERSION = 232
rem **** URL d'accès au serveur GLPI (Windows Server 2008R2)
set FISERVER=http://172.19.1.10/glpi/plugins
rem **** Indiquez ici le chemin d'accès complet au serveur vers l'exécutable de l'installation de l'agent
set INSTALLSERVER=\\sgv-sv-glpi\Partage
rem **** Verification de l'architecture 32 ou 64bits
IF EXIST "%programfiles(x86)%" goto 64b
echo Système 32 bits détecté
set PROGFOLDER=%programfiles%
echo Dossier d'installation : %PROGFOLDER%\FusionInventory-Agent
goto suite
:64b
echo Système 64bits détecté
set PROGFOLDER=%programfiles(x86)%
echo Dossier d'installation : %PROGFOLDER%\FusionInventory-Agent
goto suite
:suite
IF EXIST "%PROGFOLDER%\FusionInventory-Agent\" goto test
IF NOT EXIST "%PROGFOLDER%\FusionInventory-Agent\" goto installation
:test
for /f "delims=" %%X in ('type \\sgv-sv-glpi\Partage\VersionLaPlusRecente.txt') do (
set VERSIONLAPLUSRECENTE=%%X
)
echo %VERSIONLAPLUSRECENTE%
IF %VERSIONINSTALEE% GEQ %VERSIONLAPLUSRECENTE% goto end
IF %VERSIONINSTALEE% LSS %VERSIONLAPLUSRECENTE% goto upgrade
:upgrade
echo Upgrade requise
set N1=2
set N2=3
set N3=8
%INSTALLSERVER%\fusioninventory-agent_windows-x86_%N1%.%N2%.%N3%.exe /server="%FISERVER%/fusioninventory" /debug=1 /runnow /UPGRADE /acceptlicense /S
IF NOT ERRORLEVEL 0 goto end
echo %VERSIONLAPLUSRECENTE% > "C:\VersionFusionInventory.txt"
rem **** Etiquette d'installation de l'agent fusion inventory sur la machine cliente
:installation
echo Installation
%INSTALLSERVER%\fusioninventory-agent_windows-x86_2.3.2.exe /server="%FISERVER%/fusioninventory" /debug=1 /runnow /acceptlicense /S
IF NOT ERRORLEVEL 0 goto end
echo %VERSION% > "C:\VersionFusionInventory.txt"
goto end
:end
ECHO INSTALLATION TERMINEE
pause |
Partager