Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Erreur installation paquet - kill Windows process

Bonjour à tous,

Cela fait longtemps que je n'ai pas utilisé OCS pour faire un déploiement de logiciel.
Je pense que ça date d'avant notre dernière mise à jour ...
Server : 2.12.3
Client : 2.8

Voici le souci :
J'ai un script, qui fonctionnait sans problème avant.
Première étape : je kill un process de Windows.
Deuxième étape : j'installe le logiciel voulu.

J'ai le code erreur exit_code_1
Il plante au moment de tuer le process (le logiciel en cours d'utilisation, dans mon exemple notepad++).

Voici mon script, en fichier .bat (script très simple...)

-----------------------------------------------------------------------
@echo off
title Installation NotePad++
echo Installation in progress, please wait
echo.
echo Closing NotePad++
taskkill /im notepad++.exe /f
echo Installation "NotePad++"
msiexec /i npp.8.9.1.Installer.x64.msi /q
If exist C:\Progra~3\ (copy /Y config.model.xml C:\Progra~2\Notepa~1\) else (copy /Y config.model.xml C:\Progra~1\Notepa~1\)
echo.
echo Installation finished
exit
-----------------------------------------------------------------------

Merci pour votre aide, peut-être qu'il y a eu du changement entre la version 2.3 que j'utilisais avant et la version 2.8, parce que mon script n'a pas changé lui ...
in OCS Inventory NG agent for Windows by (210 points)

1 Answer

0 votes
please try this

@echo off
title Installation NotePad++
echo Installation in progress, please wait
echo.

echo Closing NotePad++
taskkill /im notepad++.exe /f >nul 2>&1

echo Installing "NotePad++"
msiexec /i "npp.8.9.1.Installer.x64.msi" /qn /norestart

echo.
echo Copying configuration file...
if exist "C:\Program Files\Notepad++\" (
    copy /Y config.model.xml "C:\Program Files\Notepad++\"
) else if exist "C:\Program Files (x86)\Notepad++\" (
    copy /Y config.model.xml "C:\Program Files (x86)\Notepad++\"
)

echo.
echo Installation finished
exit /B 0

The exit code 1 simply comes from the fact that Notepad++ was not running at the time of execution.
ago by (25.7k points)
edited ago by
 
Powered by Question2Answer
...