The result of that, is that if the package is executed on an endpoint that already has the Agent the Windows Installer proceeds to attempt to reinstall the agent, as it does not detect that it is already installed.
To solve this, I added logic to my installation package, to check if the Agent is already installed using its display name
Using PSADT, it looks something like this, and has worked finde so far.
- if((Get-InstalledApplication -name "ManageEngine UEMS - Agent")){
- #Already installed or up to date
- Write-log -Message "$Application is already installed"
- }
- else {
- Execute-MSI -Action Install -Path "UEMSAgent.msi" -Transform "UEMSAgent.mst" -Parameters '/qn ENABLESILENT=yes REBOOT=ReallySuppress INSTALLSOURCE=Manual SERVER_ROOT_CRT="DMRootCA-Server.crt" DS_ROOT_CRT="DMRootCA.crt"'
- }