One more issue found. NetXMS agent can't be upgraded from M1 to M2 if nxsagent (user session agent) is started. The NetXMS agent installer doesn't stop nxsagent process(es) during upgrade. As a result it can't replace C:\NetXMS\bin\libnetxms.dll library so the upgrade can't continue saying 'Delete file failed; code 5'. Of course, NetXMS agents with nxsagent enabled also can't be upgraded remotely.