SCCM does not update software that was installed manually

618 Views Asked by At

Client machines are all Windows 10 Pro (64-Bit).

If we were to have MyCompanyApp.msi installed via SCCM, we found that we could update it successfully using SCCM. Everything normal there.

HOWEVER, if I were to run MyCompanyApp.msi locally either by double clicking on the msi or running msiexec, updating it with SCCM fails. Moreover, SCCM goes ahead and runs an install as if it had never detected the previous installation. When you check Control panel, you see the product listed twice; each having a different version number.

The bottom line is that when I mix manual installation/upgrade with SCCM manual installation/upgrade, I have the problem described above. The table below should summarize things.

enter image description here

1

There are 1 best solutions below

5
Stein Åsmul On BEST ANSWER

Logging: Do you have a proper log file? If not, please create it: Enable installation logs for MSI installer without any command line arguments

msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log

Starting Point: I would seach for FindRelatedProducts and check what the log file reads in the sections found.


Debugging: Failed Major Upgrades debugging: WIX does not uninstall older version.


CAUSES? Most likely you have:

  1. An incorrectly authored upgrade table.
  2. A mix of per-machine and per-user installations.

1. Upgrade Table

Check the entries in the Upgrade table. Does it look something like this. There are MANY ways to mess this table up. The most common problem is the VERSION RANGE specified. If it is set incorrectly the version found could be outside the range identified as "valid to remove":

Upgrade


2. Installation Context: MSI does not support "cross context" updates as explained here by Rob Mensching - the creator of WiX. My follow-up comment to him there is a more or less crazy approach I used once to remove some straggling installs in the wrong context: Crazy approach. Instead: check what features SCCM has these days to remove per-user installs?

Per-User Installs: Here is a piece on why per-user installs - as implemented by MSI - are not recommended - in my opinion (and many other MSI users).

You can find the per-user installations on the machine in question like this - note that there could very well be NO per user installations:

Dim i, msi
Set installer = CreateObject("WindowsInstaller.Installer")
i = 1

For Each product In installer.ProductsEx("", "", 7)
   productcode = product.ProductCode
   name = product.InstallProperty("ProductName")
   version=product.InstallProperty("VersionString")
   allusers=product.Context
   
   ' Ignore all per-machine installations
   If(allusers <> 4) Then
      msi = msi + CStr(i) + ": " & productcode & ", " & name & ", " & version & ", " & allusers & vbNewLine & vbNewLine
      i = i + 1
   End If

Next

MsgBox msi

Remove the if section to get ALL installed MSI products. There are limits to how many characters MsgBox can show. Write to a file instead? (see mid-page here) Or use WScript.Echo msi.

Links: