Profile not installing fully when last step is reboot

Solved
CR
Chris R.
SkyBitz - End User

I have a profile with a package that executes certain scripts, installs an apk, and the last post install script is "reset /delay 5".  That last step always executes for sure as the device reboots, but the profile never shows as "Installed" in the device details pane, only "Pending Install".  The package that contains the reset command always shows as "Downloaded" and I receive an error when I try to Force Package Reinstallation.

It's like the device reboots and the package never reports as complete/installed.  How can I reboot the device as the last step of a package/profile and get it to update properly? 

3 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
3 years ago

I usually don't like including forced reboots in my Packages since future updates to that Package will result in another reboot which may not be desirable when updating production devices. I would suggest maybe creating a separate Package that only contains a reboot script and then to have that installed after your primary APK based package in sequence in the Profile. You could even put in a Package dependency to ensure that your APK Package has been installed and reported as such before the reboot package is installed. 

CR
Chris R.
3 years ago

Hi Matt,

That's actually what I've done here.  We require a reboot after installing an update to our application so I have a separate package built named "Reboot" that only has the reset script in it.  Once the other packages have finished, it executes properly and reboots the device.  The issue is the Reboot package never shows as finished, only Downloaded so that also causes issues with other profiles that may need assigned as the profile shows as Pending Install.

CR
Chris R.
3 years ago

I tried adding the "finishpkg" cmd to the script after the reset but that doesn't work either.  I'm guessing it reboots before that part of the script can be executed.

reset /delay 5
finishpkg

CR
Chris R.
3 years ago

I think I've fixed it by putting the finishpkg on the same line as the reset cmd.  This has worked on a handful of devices so far, but should know more when I perform a mass push tomorrow.

reset /delay 5 finishpkg

Solution