4

I'm creating an SCCM 2012 R2 application for Office 365. The install works fine (exits with code 0), however the application fails on detection. In testing, I'm trying a registry detection (as per this TechNet article and a folder detection (since the registry one doesn't work) with an "OR" relationship; if either are found, it should mark as successful.

After the package installs and "fails" detection, if I look at the filesystem and the registry, both of the two entries used in detection are there. I can see in AppDiscovery.log that it's trying and failing the detection, but it's not showing me exactly what it's testing and what it's getting back from the OS. I'm testing 32-bit Office on 32-bit Windows initially, so 32 vs 64 bit isn't an issue. I'm at a loss as to what to look at next; hopefully someone can put me on track?

Application Detections (with an OR relationship):

Registry: HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\O365ProPlusRetail - en-us
Filesystem: C:\Program Files\Microsoft Office 15\root\office15

AppDiscovery.log:

<![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">

EDIT: Screenshots of detection rules as requested:

Detection Rules
Filesystem Detection Rule
Registry Detection Rule

DarkMoon
  • 1,039
  • 13
  • 29
  • Can you post screenshots of the way you have configured detection in the Deploment Type properties. – alx9r Mar 08 '16 at 15:22
  • Screenshots added as requested. – DarkMoon Mar 08 '16 at 22:44
  • I _think_ your registry detection rule is detecting an _entry_ of type string named `O365ProPlusRetail - en-us` on _key_ `Uninstall`. That is different from detecting _key_ `O365ProPlusRetail - en-us` which is, I think, what you want to do. I suggest instead detecting a named entry on `O365ProPlusRetail - en-us` like `DisplayVersion` or `DisplayName`. – alx9r Mar 09 '16 at 03:06
  • It's not obvious to me why the file detection rule does not work. – alx9r Mar 09 '16 at 03:08
  • FWIW I stopped using the built-in detection schemes in favor of PowerShell detection scripts because the built-ins are impossible to test and troubleshoot separate from CcmExec which makes for impossibly slow test iterations. – alx9r Mar 09 '16 at 03:09
  • The tick next to "Use (Default) registry key value for detection" means it's looking in the key specified for the "(Default)" value, which (AFAIK) exists on all keys. And I checked in the registry, and it is indeed a String value, not Int or some other. And even if that was the case, the filesystem detection should have worked. :-S I haven't had to delve into PowerShell detection scripts yet; I try to do as much as I can using "standard" built-in methods, but this may be one of those exceptions to the rule. – DarkMoon Mar 09 '16 at 04:58
  • Oh right. Default value. I'm sorry I'm no help with this one. If you do end up going with PowerShell detection [this Q&A](http://serverfault.com/questions/699705/in-what-context-do-sccm-powershell-detection-scripts-run-in) and the "Detect-Application.ps1" section of [this answer](http://superuser.com/a/1012302) are relevant. – alx9r Mar 09 '16 at 05:15
  • Regarding the registry portion of the detection, I noticed that it is performing the detection "for user" vs. "for system": ["For User" in application log](http://i.stack.imgur.com/CHpAr.png) Perhaps the user context the app detection seems to be operating from doesn't have sufficient permissions to read from the registry? Checking the ["Deploy Office365 Pro Plus..."](https://technet.microsoft.com/en-au/library/dn708063.aspx#BKMK_Deploy) article you linked to in your original post, step 8 of "To Create Deployment Type" specifies that you should select "Install for System". Did you select this, – Bob Apr 09 '16 at 16:07
  • You can see in line 6 of AppEnforce.log above "Context: Machine". As per the answer I posted, I corrected the filesystem detection, which now works, and scrapped the registry detection. – DarkMoon Apr 10 '16 at 01:11

2 Answers2

1

So for the record, a fair bit of reading around seems to show that detection methods are iffy; what works for some doesn't work for others. I've switched this from the registry-based detection to a MSI code-based detection, only to find that this won't work in Office 365 (2016), as it doesn't seem to "install" the ProPlus package, only a few helper packages.

The moral of the story seems to be to try different ways, find which one works for you, and use that. There is no hard and fast rule for the "best" method for everyone.

Also, FWIW, in the filesystem screenshot above, I missed that it was configured to look for a file, but I was supplying it with a folder. Reconfiguring for a folder seems to have worked. I still don't understand why the registry detection didn't work, but I'm past my current hurdle.

DarkMoon
  • 1,039
  • 13
  • 29