Sign in to follow this  
Followers 0
am632

Script nearly perfect, just wont exit when finished

4 posts in this topic

Hi, I have put together this script to install avg with a small gui. Progress bar thanks to Melba23 & Sh3llC043r (http://www.autoitscript.com/forum/index.php?showtopic=111468&st=0&p=782000&#entry782000)

The script works fine, and installs avg silently but it wont close itself when it finishes. Im sure its something simple but I cant figure it out. Anyway heres the code

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>

$hGUI = GUICreate("Installing AVG 9 Free", 480, 320)
GuiCtrlCreatePic("avgbackground-big.jpg",0,0, 480,320)

Run("avg_free_90_790a2730.exe /HIDE /DISABLE_SCAN /NOAVGTOOLBAR")

GUICtrlCreateProgress(165, 211, 150, 20, $PBS_MARQUEE)
_SendMessage(GUICtrlGetHandle(-1), $PBM_SETMARQUEE, True, 100)
GUISetState()

While 1
   Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
         Exit
    EndSwitch
WEnd

if ProcessExists("avg_free_90_790a2730.exe") Then
ProcessWaitClose("avg_free_90_790a2730.exe")
Exit
else
    Exit
endif

Also on a different matter, I couldnt find the switch to turn the scan off when avg is installing so if anyone knows it, that would also be gr8 :(

thanks

Share this post


Link to post
Share on other sites



Hi, tnx for the reply. I havnt tried that switch but I hav just this second sussed it. I just deleted the lines

While 1
   Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
         Exit
    EndSwitch
WEnd

and now it works fine except the close button doesnt close it - im not fussed about this tho anyway.

Share this post


Link to post
Share on other sites

While 1
    $msg = GUIGetMsg()
        
    If $msg = $GUI_EVENT_CLOSE Then 
        GUIDelete()
        Exit
    EndIf
Wend

Try this instead your own.

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  
Followers 0