Non-standard MSI product code in MSI agent package

Non-standard MSI product code in MSI agent package

I opted to deploy the Agent using the MSI method in our environment.
Already on my first attempt I ran into an issue that the MSI Product code of the installer, does not match the MSI product code one the Agent was installed

product code in the Installer: {DCEE}
product code when Installed: {90BE921B-318B-323E-9AA0-53749FABBE4E}

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.
  1. if((Get-InstalledApplication -name "ManageEngine UEMS - Agent")){
  2.             #Already installed or up to date
  3.             Write-log -Message "$Application is already installed"

  4.         }
  5.         else {

  6.             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"'

  7.         }
Now however, I have found a couple of servers with an antique piece of software:
"Microsoft Dynamics AX 2009 Components (64 bit)"

Microsoft being absolute geniuses back then, opted to give that application the same "illegal" product code: {DCEE}

and trying to install the agent yields no results, as the product code already exists on the device.

> Found installed application [Microsoft Dynamics AX 2009 Components (64 bit)] version [5.0.593.0] matching product code [DCEE].
> The MSI is already installed on this system. Skipping action [Install]...

Please use Valid MSI Product codes in your MSI's
                New to ADManager Plus?

                  New to ADSelfService Plus?