(imported topic written by SystemAdmin)
I want to ensure that a device is not “pending restart” prior to installing a software package, the application developer has made this a requirement. I was thinking that I could put a condition in the action script that would restart the device if needed and simply setup my action to retry.
This statement seems to work:
if { (exists (key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager" of registry) whose (exists value "PendingFileRenameOperations" of it )) }
restart 10
else
...
endif
but this does not, it always evaluates to true:
if { pending restart }
restart 10
else
...
endif
Should I be able to do this? I know there would be some issues with devices always showing pendng restart and may consider some additional relevance to take that into account, but I just wanted to demonstrate the most basic situation. Is there a better way of designing this altogether?