我正在为 Office 365 创建一个 SCCM 2012 R2 应用程序。安装工作正常(以代码 0 退出),但是该应用程序在检测时失败。在测试中,我正在尝试使用“或”关系进行注册表检测(根据这篇 TechNet 文章和文件夹检测(因为注册表不起作用));如果找到任何一个,它应该标记为成功。
在包安装和“失败”检测之后,如果我查看文件系统和注册表,检测中使用的两个条目都在那里。我可以在 AppDiscovery.log 中看到它正在尝试并未能通过检测,但它并没有准确地向我展示它正在测试什么以及它从操作系统返回什么。我最初在 32 位 Windows 上测试 32 位 Office,因此 32 位与 64 位不是问题。我不知道接下来要看什么;希望有人能让我走上正轨?
应用程序检测(具有 OR 关系):
Registry: HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\O365ProPlusRetail - en-us
Filesystem: C:\Program Files\Microsoft Office 15\root\office15
应用发现日志:
<![LOG[Entering ExecQueryAsync for query "select * from CCM_AppDeliveryType where (AppDeliveryTypeId = "ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f" AND Revision = 6)"]LOG]!><time="15:15:24.396-600" date="03-08-2016" component="AppDiscovery" context="" type="1" thread="156" file="appprovider.cpp:406">
<![LOG[ Performing detection of app deployment type Install - Microsoft Office 365 ProPlus x86(ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, revision 6) for user.]LOG]!><time="15:15:24.399-600" date="03-08-2016" component="AppDiscovery" context="" type="1" thread="156" file="appprovider.cpp:2148">
<![LOG[+++ Application not discovered. [AppDT Id: ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, Revision: 6]]LOG]!><time="15:15:24.416-600" date="03-08-2016" component="AppDiscovery" context="" type="1" thread="156" file="localapphandler.cpp:291">
<![LOG[+++ Did not detect app deployment type Install - Microsoft Office 365 ProPlus x86(ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, revision 6) for S-1-5-21-977620602-469372654-314601362-40834.]LOG]!><time="15:15:24.416-600" date="03-08-2016" component="AppDiscovery" context="" type="1" thread="156" file="appprovider.cpp:540">
AppEnforce.log:
<![LOG[+++ Starting Install enforcement for App DT "Install - Microsoft Office 365 ProPlus x86" ApplicationDeliveryType - ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, Revision - 5, ContentPath - C:\WINDOWS\ccmcache\2, Execution Context - System]LOG]!><time="14:55:26.517-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appprovider.cpp:1702">
<![LOG[ A user is logged on to the system.]LOG]!><time="14:55:26.517-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appprovider.cpp:2083">
<![LOG[ Performing detection of app deployment type Install - Microsoft Office 365 ProPlus x86(ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, revision 5) for user.]LOG]!><time="14:55:26.521-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appprovider.cpp:2148">
<![LOG[+++ Application not discovered. [AppDT Id: ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, Revision: 5]]LOG]!><time="14:55:26.574-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="localapphandler.cpp:291">
<![LOG[ App enforcement environment:
Context: Machine
Command line: Setup.exe /configure Install.xml
Allow user interaction: No
UI mode: 1
User token: not null
Session Id: 1
Content path: C:\WINDOWS\ccmcache\2
Working directory: ]LOG]!><time="14:55:26.574-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appcontext.cpp:85">
<![LOG[ Prepared working directory: C:\WINDOWS\ccmcache\2]LOG]!><time="14:55:26.580-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appcontext.cpp:189">
<![LOG[ Prepared command line: "C:\WINDOWS\ccmcache\2\setup.exe" /configure Install.xml]LOG]!><time="14:55:26.581-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appcontext.cpp:338">
<![LOG[ Executing Command line: "C:\WINDOWS\ccmcache\2\setup.exe" /configure Install.xml with user context]LOG]!><time="14:55:26.582-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appexcnlib.cpp:205">
<![LOG[ Working directory C:\WINDOWS\ccmcache\2]LOG]!><time="14:55:26.582-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appexcnlib.cpp:219">
<![LOG[ Post install behavior is BasedOnExitCode]LOG]!><time="14:55:26.799-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appcommon.cpp:1094">
<![LOG[ Waiting for process 3624 to finish. Timeout = 15 minutes.]LOG]!><time="14:55:26.802-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appexcnlib.cpp:2015">
<![LOG[ Process 3624 terminated with exitcode: 0]LOG]!><time="15:00:02.687-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appexcnlib.cpp:2024">
<![LOG[ Looking for exit code 0 in exit codes table...]LOG]!><time="15:00:02.688-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appexcnlib.cpp:508">
<![LOG[ Matched exit code 0 to a Success entry in exit codes table.]LOG]!><time="15:00:02.688-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appexcnlib.cpp:587">
<![LOG[ Performing detection of app deployment type Install - Microsoft Office 365 ProPlus x86(ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, revision 5) for user.]LOG]!><time="15:00:02.762-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appprovider.cpp:2148">
<![LOG[+++ Application not discovered. [AppDT Id: ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f, Revision: 5]]LOG]!><time="15:00:02.955-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="localapphandler.cpp:291">
<![LOG[++++++ App enforcement completed (276 seconds) for App DT "Install - Microsoft Office 365 ProPlus x86" [ScopeId_C0FD4C5A-19CA-4D29-AE82-1FC626708B30/DeploymentType_306fa062-57f5-4481-b17a-8e9caeeba49f], Revision: 5, User SID: S-1-5-21-977620602-469372654-314601362-40834] ++++++]LOG]!><time="15:00:02.961-600" date="03-08-2016" component="AppEnforce" context="" type="1" thread="1904" file="appprovider.cpp:2450">
编辑:按要求截取检测规则:
所以为了记录,相当多的阅读似乎表明检测方法是不确定的。对某些人有效的东西对其他人无效。我已将其从基于注册表的检测切换到基于 MSI 代码的检测,却发现这在 Office 365 (2016) 中不起作用,因为它似乎没有“安装”ProPlus 包,只有一些帮助程序包。
这个故事的寓意似乎是尝试不同的方法,找到适合你的方法,然后使用它。对于每个人来说,“最佳”方法没有硬性规定。
另外,FWIW,在上面的文件系统屏幕截图中,我错过了它被配置为查找文件,但我为它提供了一个文件夹。重新配置文件夹似乎有效。我仍然不明白为什么注册表检测不起作用,但我已经克服了目前的障碍。
我认为这回答了为什么您的注册表检测不起作用:
https://social.technet.microsoft.com/Forums/en-US/22cd9ce3-399a-4fdc-a5e8-c724216620d2/configmgr-2012-sp1-cu3-registry-key-detection-method-not-working-correctly?论坛=configmanagerapps。