SCCM does not update software that was installed manually

喜欢而已 提交于 2021-02-11 08:08:14

问题


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.


回答1:


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":


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:

  • The different installation contexts. Enum MsiInstallContext:

    • Const msiInstallContextAllUserManaged = 8
    • Const msiInstallContextFirstVisible = 0
    • Const msiInstallContextMachine = 4
    • Const msiInstallContextUser = 2
    • Const msiInstallContextUserManaged = 1
  • The Windows Installer Automation Interface (COM automation).



来源:https://stackoverflow.com/questions/63514655/sccm-does-not-update-software-that-was-installed-manually

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!