Jump to content

Time Count Down


Recommended Posts

I'm pushing out an app that requires a reboot, but the installer does not do it on it's own. I want to give the user the chance to reboot on there own, but I'm going to nag them about it. Pardon my logic, but it works for me.

The only part I'm stuck on is the splash screen and the time count down. I don't know if this is stupid or not, but I wanted to throw this out to see what you all thought. I want the seconds to show as 2 digits instead of just 1 when it gets into the single digits. "09" instead of just "9"

$loop = 1
$answer1=MsgBox(4, $loop,"Reboot?")
if $answer1 = 6 then 
    _shutdown()
Else
    $loop = $loop + 1
EndIf


Do
    Sleep(1000)
    $answer2=MsgBox(4, $loop,"Reboot?")
    if $answer2 = 6 then 
        _shutdown()
    EndIf
    $loop = $loop + 1
Until $loop > 3

$timeMin = 4
$timeSec = 10

$timeLeft=500
do
SplashTextOn("Engineering", "Your PC will reboot in:" & @CR & $timeMin & ":" & $timeSec, 100, 50)
Sleep(1000)
$timeSec = $timeSec-1
if $timeSec < 0 Then
    $timeSec = 59
    $timeMin = $timeMin - 1
EndIf
Until $timeMin = 0

_shutdown()


Func _shutdown()
    MsgBox(0, "", "SHUTDOWN(2)")
;Shutdown(2)
    Exit
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...