WindowsAgent icon indicating copy to clipboard operation
WindowsAgent copied to clipboard

[BUG] Upgrade - Downloader still 2.9.1.0

Open LMS235 opened this issue 2 years ago • 7 comments

General information

Operating system : WIN10 64, WIN11 64

OCS Inventory information

Windows agent version : 2.10.0.0 (Upgrade vom 2.9.2.0)

Problem's description

After the update (according to the instructions here) the agent is on version 2.10.0.0, but the download service remains on 2.9.1.0 (it was not touched with 2.9.2.0).

Here is the script I use for the upgrade package:

%~dp0\OCS-Windows-Agent-Setup-x64.exe /S /server=https://SERVERNAME/ocsinventory /ssl=1 /debug=0 /NO_SYSTRAY /NOW /CaBundle=cacert.pem /ca=cacert.pem
timeout /T 30 /NOBREAK
sc config "OCS Inventory Service" start=delayed-auto
sc failure "OCS Inventory Service" reset= 30 actions= restart/30000/restart/30000//1000
exit 0

So Agent ist OK: image

Downloader NOT: image

Here we finally need a reliable solution on how to deal with the problem. There is currently no clean, 100% working solution to update the OCS agent cleanly via OCS.

In the last versions there was at least the command line option "/upgrade", but this is no longer available.

LMS235 avatar Oct 27 '22 06:10 LMS235

I think it is not ok. After updating the agent to version 2.10.0.0, all my stations stopped being inventoried.

obraz

Windows EventLog:

Faulting application name: OCSInventory.exe, version: 2.10.0.0, time stamp: 0x634cffd7
Faulting module name: SysInfo.dll, version: 2.9.1.0, time stamp: 0x62135247
Exception code: 0xc0000005
Error offset: 0x000000000000cd75
Faulting process id: 0x3fd4
Faulting application start time: 0x01d8eca7fcc0274d
Faulting application path: C: \ Program Files \ OCS Inventory Agent \ OCSInventory.exe
Faulting module path: C: \ Program Files \ OCS Inventory Agent \ SysInfo.dll
Report ID: e49a9e3d-0096-4c40-84ed-1ead9b0dbcd4
Faulting package full name:
Application ID relative to the error package:

However, if I update with the same command (!!) via the command line (eg via psexec) everything updates fine. What is additionally doing OCS now that updating via the OCS package (deployment package) is now impossible?

ajavor avatar Oct 30 '22 20:10 ajavor

I'm doing the upgrade now with a workaround. Not pretty, but works. It can't replace "Download.exe" because it runs itself, so I kill the process first.

if exist %SystemRoot%\TEMP\OCS_21000 (
    rem OCS Update gelaufen
	exit 0
) else (
    rem OCS Update
	sc stop "OCS Inventory Service"
	taskkill /F /IM Download.exe
	%~dp0\OCS-Windows-Agent-Setup-x64.exe /S /server=SERVERNAME/ocsinventory /ssl=1 /debug=0 /NO_SYSTRAY /NOW /CaBundle=cacert.pem /ca=cacert.pem
	timeout /T 30 /NOBREAK
	sc config "OCS Inventory Service" start=delayed-auto
	sc failure "OCS Inventory Service" reset= 30 actions= restart/30000/restart/30000//1000
	copy /y NUL %SystemRoot%\TEMP\OCS_21000 >NUL
	exit 0
)

But here it needs a real solution! In the past there was also the parameter /upgrade, why is this no longer available?

LMS235 avatar Nov 02 '22 13:11 LMS235

Having the same Problem with version > 2.9

Also having the problem, that the client isn't launching automatically according to the PROLOG_FREQ settings. You encountered something similiar?

thomasgg23 avatar Dec 02 '22 09:12 thomasgg23

Hi, how can i upgrade the agent version on only few PC to test? There is a wiki to follow to update the agent? I deployed the agent with a GPO and the packager. I don't want the inventory stop for all my PC if i upgrade.

laragio avatar Dec 22 '22 08:12 laragio

Is there anything new on this topic? I also distributed the upgrade to 2.10.1 via workaround (see above).

Surely there should be a clean solution here?

LMS235 avatar Feb 02 '23 09:02 LMS235

Hi, can you provide a howto to complete without problem an upgrade of the agent?

laragio avatar Mar 23 '23 11:03 laragio

Hi, can you provide a howto to complete without problem an upgrade of the agent?

Hi,

I have built a batch file as already written above (https://github.com/OCSInventory-NG/WindowsAgent/issues/260#issuecomment-1300389523) with which I perform the upgrade. Then when the upgrade runs it kills the OCS processes and also kills the download.exe process. Once the setup is done I create a file in the TMP folder and start OCS again. Since OCS then has not noticed the successful update, the installer would run again and again, I then check this with the created file (if file exists = OK, Exit 0).

It's not pretty, but it works.

LMS235 avatar Mar 24 '23 07:03 LMS235