This while loop and the EnumProcess Function did the trick. Thanks Man!!!!

shell '... '
sleep 5
while EnumProcess("setup.exe")
sleep 2
loop
$RC = Shutdown("", "System is being restarted to enable new settings.", 0, 1, 1)