SCCM 不会更新手动安装的软件 [英] SCCM does not update software that was installed manually

查看:46
本文介绍了SCCM 不会更新手动安装的软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

客户端机器都是 Windows 10 Pro(64 位).

如果我们通过 SCCM 安装 MyCompanyApp.msi,我们发现可以使用 SCCM 成功更新它.那里一切正常.

但是,如果我通过双击 msi 或运行 msiexec 在本地运行 MyCompanyApp.msi,则使用 SCCM 更新它会失败.此外,SCCM 继续运行安装,就好像它从未检测到以前的安装一样.当您检查控制面板时,您会看到该产品列出了两次;每个都有不同的版本号.

最重要的是,当我将手动安装/升级与 SCCM 手动安装/升级混合使用时,我遇到了上述问题.下表总结了一些事情.

解决方案

日志:您有合适的日志文件吗?如果没有,请创建它:


2.安装上下文:MSI 不支持跨上下文";正如 WiX 的创造者 Rob Mensching 在此处解释的那样更新.我对他的后续评论有一种或多或少的疯狂方法,我曾经使用过在错误的上下文中删除一些分散的安装:Crazy approach.相反:检查 SCCM 现在有哪些功能可以删除每用户安装?

每用户安装:这里有一篇关于每用户安装的原因- 由 MSI 实施 - 不推荐 - 在我看来(以及许多其他 MSI 用户).

您可以像这样在有问题的机器上找到每个用户的安装 - 注意很可能没有每个用户的安装:

Dim i, msiSet installer = CreateObject("WindowsInstaller.Installer")我 = 1对于每个产品在 installer.ProductsEx("", "", 7)产品代码 = 产品.产品代码name = product.InstallProperty("ProductName")version=product.InstallProperty(VersionString")allusers=product.Context' 忽略所有每台机器的安装如果(所有用户<> 4)那么msi = msi + CStr(i) + ": ";&产品代码","&姓名 &","&版本&","&所有用户vbNewLine &新行我 = 我 + 1万一下一个消息框微信

删除 if 部分以获取所有已安装的 MSI 产品.MsgBox 可以显示的字符数是有限制的.改为写入文件?(见中间页)或使用WScript.Echo msi.

链接:

  • 不同的安装上下文.枚举 MsiInstallContext:

    • Const msiInstallContextAllUserManaged = 8
    • Const msiInstallContextFirstVisible = 0
    • const msiInstallContextMachine = 4
    • const msiInstallContextUser = 2
    • Const msiInstallContextUserManaged = 1
  • Windows 安装程序自动化界面(COM 自动化).

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.

解决方案

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:

这篇关于SCCM 不会更新手动安装的软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆