3010 vs 1641 Return code derps

Recently I packaged a series of applications for a customer and ran across an interesting behavior when deploying applications in a dependency chain. Let’s say for example you have 3 applications in a dependency chain.

App A depends on App B depends on App C.

When you deploy App A, Config Manager will actually start at the bottom of the chain and work it’s way up, detecting if each application is installed prior to installing. This means it will first run application detection on App C, if it’s not installed it will install it, otherwise it will move on to App B and so on.

What if App C returns a 3010 return code back to config mgr? We all know a 3010 is ‘Reboot Required’ right? If App C returns a 3010 the user is prompted that a restart is required. No big deal right? Wrong. If App C returns a 3010, it prompts the user to restart their computer, but it continues on through the dependency chain. Although App C requires a reboot, Config Mgr detects if App B is installed, if it’s not, it begins installing it.

The problem is, when App C returns a 3010, the user is prompted to restart their computer. But, when they click ‘Restart Now’, the user is presented with a window explaining the system cannot be restarted at this time. So what does the user do? They click the Start button, and reboot it themselves. You would think this would be ok, except for the fact that when they reboot, Config Mgr is actually installing App B. This could be really bad and cause App B’s installation to be completely hosed.

Now I knew there was a return code 1641 that also has a reboot behavior. The description of 1641 is ‘Hard Reboot’. I always assumed this meant if a 1641 was returned, the computer would reboot immediately without warning. This week, I found out that’s not the case. Instead, return code 1641 means a ‘Pending Hard Reboot’ The behavior of 1641 is actually what I needed for my dependency chain. 1641 tells Config Mgr, “I need to reboot, and I’m not going to allow anything else to install UNTIL I’ve rebooted”.

So if you run into a scenario where you don’t want any other applications or software updates to install until the system has rebooted, use a 1641, not a 3010.



Leave a Reply

Your email address will not be published. Required fields are marked *