Jump to content
Sign in to follow this  
Ryhame92

Loop

Recommended Posts

Ryhame92

Please help me :whistle:

I want to deploy application to users computers and leave them the choice to launch the installation immédiatly or later

the user is propmted for the install if he click on "yes" a file -install.cmd" is opend to start the install if he click on 'no" the script is stoped I like to repeat the popup evry 20 minuts for 5 time after the installation is forced

Thank's

Share this post


Link to post
Share on other sites
Ryhame92

This the script wich i modify

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

Global $LblTxt, $BtnOK, $BtnNO

$FormOptions = GUICreate("Déploimenent", 600, 200, -1, -1, BitOr($WS_POPUP,$WS_DLGFRAME, $DS_SETFOREGROUND))

GUICtrlCreateLabel("Voulez-vous installer l'application maintenant?", 30, 10)

$Btn2 =GUICtrlCreateButton("Non", 160, 55, 75, 25, 0)

GUICtrlSetOnEvent(-1, "_Exit")

$Btn1 = GUICtrlCreateButton("OUI", 80, 55, 75, 25, 0)

GUICtrlSetOnEvent(-1, "_Start")

GUISetState(@SW_SHOW, $FormOptions)

While 1

Sleep(5)

WEnd

Func _MsgBox($MsgTitle, $MsgBtn1, $MsgBtn2, $MsgIconFile, $MsgIconNo, $MsgText)

$FormCountDownMsG = GUICreate($MsgTitle, 300, 110, -1, -1, $WS_DLGFRAME)

;$BtnOK = GUICtrlCreateButton($MsgBtn1, 80, 55, 75, 25, 0)

;GUICtrlSetOnEvent(-1, "_MsgBtnOK")

;$BtnCancel = GUICtrlCreateButton($MsgBtn2, 190, 55, 75, 25, 0)

;GUICtrlSetOnEvent(-1, "_Exit")

;$Icon = GUICtrlCreateIcon($MsgIconFile, $MsgIconNo, 16, 16, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))

$LblTxt = GUICtrlCreateLabel($MsgText, 72, 16, 210, 25)

GUISetState(@SW_SHOW, $FormCountDownMsG)

EndFunc

;Func _MsgBtnOK()

; MsgBox(16,"Déploiment en cours merci depatienter","Déploiment en cours merci depatienter")

;EndFunc

Func _Exit()

Exit

EndFunc

Func _MsgBoxCountDown()

For $i = 10 To 1 Step -1

GUICtrlSetData($LblTxt, "L'installation commence dans "&$i&" sec. Fermez toutes les applications office")

GUICtrlSetData ($BtnOK, "OK ( "&$i&" )" )

sleep(1000)

If $i = 1 Then

Return -1

EndIf

Next

EndFunc

Func _Start()

GUISetState(@SW_HIDE, $FormOptions)

_MsgBox("Déploiement de l'application", "OK", "Cancel", "Shell32.dll", 221, "")

$MsgCounterEnd = _MsgBoxCountDown()

If $MsgCounterEnd = -1 Then

ShellExecuteWait("_install.cmd")

;MsgBox(16,"Déploiment en cours merci depatienter","Déploiment en cours merci depatienter 2")

Exit

EndIf

EndFunc

Share this post


Link to post
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
Sign in to follow this  

×